public class SSOTokenManager extends Object
SSOTokenManager is a singleton class; there can be, at most, only one instance of SSOTokenManager in any given JVM.
SSOTokenManager currently supports only two kinds of provider: Grappa and OpenAM.
It is assumed that the provider classes or the JAR file is in the
CLASSPATH so that they can be found automatically. Providers can be
configured using providerimplclass
property.
This property must be set to the complete (absolute) package name of the
main class of the provider. For example, if the provider class is
com.iplanet.sso.providers.dpro.SSOProviderImpl, that entire class name
including package prefixes MUST be specified. The main class MUST implement
the com.iplanet.sso.SSOProvider interface and MUST have a public no-arg
default constructor.
The class SSOTokenManager
is a final
class that
provides interfaces to create and validate SSOToken
s.
It is a singleton class; an instance of this class can be obtained by calling
SSOTokenManager.getInstance()
.
Having obtained an instance of SSOTokenManager
, its methods
can be called to create SSOToken
, get SSOToken
given the SSOTokenID
in string format, and to validate
SSOToken
s.
Modifier and Type | Method and Description |
---|---|
SSOToken |
createSSOToken(javax.servlet.http.HttpServletRequest request)
Creates a single sign on token from
HttpServletRequest |
SSOToken |
createSSOToken(String tokenId)
Creates a single sign on token from the single sign
on token ID.
|
SSOToken |
createSSOToken(String tokenId,
String clientIP)
Creates a single sign on token from the single sign
on token ID.
|
void |
destroyToken(SSOToken token)
Destroys a single sign on token.
|
void |
destroyToken(SSOToken destroyer,
SSOToken destroyed)
Destroys a single sign on token.
|
static SSOTokenManager |
getInstance()
Returns the singleton instance of
SSOTokenManager . |
Set |
getValidSessions(SSOToken requester,
String server)
Returns a list of single sign on token objects
which correspond to valid Sessions accessible to requester.
|
boolean |
isValidToken(SSOToken token)
Returns true if a single sign on token is valid.
|
boolean |
isValidToken(SSOToken token,
boolean resetIdleTime)
Returns true if a single sign on token is valid, resetting the token's idle time
if and only if the flag allows us to.
|
void |
refreshSession(SSOToken token)
Refresh the Session corresponding to the single
sign on token from the Session Server.
|
void |
validateToken(SSOToken token)
Returns true if the single sign on token is valid.
|
public static SSOTokenManager getInstance() throws SSOException
SSOTokenManager
.SSOTokenManager
instanceSSOException
- if unable to get the singleton SSOTokenManager
instance.public SSOToken createSSOToken(javax.servlet.http.HttpServletRequest request) throws UnsupportedOperationException, SSOException
HttpServletRequest
request
- The HttpServletRequest
object which contains
the session string.SSOToken
SSOException
- if the single sign on token cannot be created.UnsupportedOperationException
- if this is an unsupported operation.public SSOToken createSSOToken(String tokenId) throws UnsupportedOperationException, SSOException
creatSSOToken(String, String)
OR
createSSOToken(HttpServletRequest)
.tokenId
- Token ID of the single sign on tokenSSOException
- if the single sign on token cannot be created.UnsupportedOperationException
- If the operation is not supported by the provider.public SSOToken createSSOToken(String tokenId, String clientIP) throws UnsupportedOperationException, SSOException
tokenId
- Token ID of the single sign on tokenclientIP
- Client IP address. This must be the IP address of the
client/user who is accessing the application.SSOException
- if the single sign on token cannot be created.UnsupportedOperationException
- If the operation is not supported by the provider.public boolean isValidToken(SSOToken token)
token
- The single sign on token object to be validated.public boolean isValidToken(SSOToken token, boolean resetIdleTime)
token
- The single sign on token object to be validated.public void validateToken(SSOToken token) throws SSOException
token
- The single sign on token object to be validated.SSOException
- if the single sign on token is not valid.public void destroyToken(SSOToken token) throws SSOException
token
- The single sign on token object to be destroyed.SSOException
- if there was an error while destroying the token, or the
corresponding session reached its maximum session/idle
time, or the session was destroyed.public void refreshSession(SSOToken token) throws SSOException
token
- single sign on tokenSSOException
- if the session reached its maximum session time, or the
session was destroyed, or there was an error while
refreshing the session.public void destroyToken(SSOToken destroyer, SSOToken destroyed) throws SSOException
destroyer
- The single sign on token object used to authorize the
operationdestroyed
- The single sign on token object to be destroyed.SSOException
- if the there was an error during communication with session
service.public Set getValidSessions(SSOToken requester, String server) throws SSOException
requester
- The single sign on token object used to authorize the
operationserver
- The server for which the valid sessions are to be retrievedSSOException
- if the there was an error during communication with session
service.Copyright © 2010-2018, ForgeRock All Rights Reserved.