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 | Field and Description |
---|---|
static Debug |
debug
Debug class that can be used by SSOProvider implementations
|
Modifier and Type | Method and Description |
---|---|
SSOToken |
createSSOToken(javax.servlet.http.HttpServletRequest request)
Creates a single sign on token from
HttpServletRequest |
SSOToken |
createSSOToken(Principal user,
String password)
Deprecated.
This method has been deprecated. Please use the regular LDAP
authentication mechanism instead. More information on how to
use the authentication programming interfaces as well as the
code samples can be obtained from the "Authenticating Using
OpenAM Java SDK" chapter of the OpenAM Developer's Guide.
|
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 |
logout(SSOToken token)
Logs out of any OpenAM session associated with the token without destroying the token itself.
|
void |
refreshSession(SSOToken token)
Refresh the Session corresponding to the single
sign on token from the Session Server.
|
void |
refreshSessionWithoutIdleReset(SSOToken token)
This function will never reset the idle time of the refreshed token.
|
SSOToken |
retrieveValidTokenWithoutResettingIdleTime(String tokenId)
Call this function if you want to retrieve a token whose id you know, you expect to be valid
(this function will not create a new token for you) and you don't want its idle time accidentally
reset.
|
void |
validateToken(SSOToken token)
Returns true if the single sign on token is valid.
|
public static final Debug debug
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(Principal user, String password) throws UnsupportedOperationException, SSOException
getAuthType(), getHostName(), getIPAddress(), setProperty(String name, String value), getProperty(String name), isValid(), validate().
user
- Principal representing a user or servicepassword
- The password supplied for the principalSSOException
- 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
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
public SSOToken retrieveValidTokenWithoutResettingIdleTime(String tokenId) throws UnsupportedOperationException, SSOException
tokenId
- The token id of the token you suspect is valid.UnsupportedOperationException
SSOException
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 refreshSessionWithoutIdleReset(SSOToken token) throws SSOException
refreshSession(SSOToken)
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.public void logout(SSOToken token) throws SSOException
token
- the token to log out.SSOException
- if an error occurs.Copyright © 2010–2025 Open Identity Platform Community. All rights reserved.