org.jboss.security.sso.util
Class SSOUtil

java.lang.Object
  extended by org.jboss.security.sso.util.SSOUtil

public class SSOUtil
extends java.lang.Object

Author:
Sohil Shah - sohil.shah@jboss.com

Constructor Summary
SSOUtil()
           
 
Method Summary
static java.lang.String cleanSSOToken(java.lang.String ssoToken)
          Removes unwanted characters from the token coming in as a browser cookie
static java.lang.String generateToken(AuthResponse response)
          Utility method for generating an SSO token from the input AuthResponse object
static AuthResponse getAuthResponse(java.lang.String ssoToken)
          Utility method that produces the AuthResponse object from the SSO Token
static java.lang.String getSSOToken(javax.servlet.http.HttpServletRequest request, java.lang.String tokenName)
          Returns the SSOToken which is one of the cookies in the http request coming in
static java.lang.String getUsername(java.lang.String ssoToken)
          Utility method that extracts the username from the SSO token
static boolean isTokenValid(java.lang.String ssoToken)
          Utility method which checks the validity of an SSO token
static java.lang.String marshalPartners(java.util.Map partners)
          This method returns a SAML (xml) representation of a map of partners that are part of this Single Sign On federation
static java.util.Map unmarshalPartners(java.lang.String partners)
          This method unmarshals a SAML (xml) representation of partners that are part of this Single Sign On Federation It returns a map of these partners with key - domain of the partner value - the address of the federation server of this partner
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSOUtil

public SSOUtil()
Method Detail

getSSOToken

public static java.lang.String getSSOToken(javax.servlet.http.HttpServletRequest request,
                                           java.lang.String tokenName)
Returns the SSOToken which is one of the cookies in the http request coming in

Parameters:
request -
tokenName -
Returns:

cleanSSOToken

public static java.lang.String cleanSSOToken(java.lang.String ssoToken)
Removes unwanted characters from the token coming in as a browser cookie

Parameters:
ssoToken -
Returns:

getUsername

public static java.lang.String getUsername(java.lang.String ssoToken)
                                    throws SSOException
Utility method that extracts the username from the SSO token

Parameters:
ssoToken -
Returns:
Throws:
SSOException

getAuthResponse

public static AuthResponse getAuthResponse(java.lang.String ssoToken)
                                    throws SSOException
Utility method that produces the AuthResponse object from the SSO Token

Parameters:
ssoToken -
Returns:
Throws:
SSOException

isTokenValid

public static boolean isTokenValid(java.lang.String ssoToken)
                            throws SSOException
Utility method which checks the validity of an SSO token

Parameters:
ssoToken -
Returns:
Throws:
SSOException

generateToken

public static java.lang.String generateToken(AuthResponse response)
                                      throws SSOException
Utility method for generating an SSO token from the input AuthResponse object

Parameters:
response -
Returns:
Throws:
SSOException

marshalPartners

public static java.lang.String marshalPartners(java.util.Map partners)
                                        throws SSOException
This method returns a SAML (xml) representation of a map of partners that are part of this Single Sign On federation

Parameters:
partners - - a map of partners belonging to the SSO Federation
Returns:
Throws:
SSOException

unmarshalPartners

public static java.util.Map unmarshalPartners(java.lang.String partners)
                                       throws SSOException
This method unmarshals a SAML (xml) representation of partners that are part of this Single Sign On Federation It returns a map of these partners with key - domain of the partner value - the address of the federation server of this partner

Returns:
Throws:
SSOException