public final class SSOProviderImpl extends Object implements SSOProvider
final
class SSOProviderImpl
implements
SSOProvider
interface and provides implementation of the methods
to create , destroy , check the validity of a single sign on token.
Note: Used by ClientSDK, therefore must not use Guice for initialisation.Constructor and Description |
---|
SSOProviderImpl()
Constructs a instance of
SSOProviderImpl |
Modifier and Type | Method and Description |
---|---|
SSOToken |
createSSOToken(javax.servlet.http.HttpServletRequest request)
Creates a single sign on token for the
HttpRequest |
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)
Deprecated.
Use #createSSOToken(String, String)
|
SSOToken |
createSSOToken(String tokenId,
boolean invokedByAuth)
Creates a single sign on token.
|
SSOToken |
createSSOToken(String tokenId,
boolean invokedByAuth,
boolean possiblyResetIdleTime)
Creates a single sign on token.
|
SSOToken |
createSSOToken(String tokenId,
String clientIP)
Deprecated.
Use #createSSOToken(String, String)
|
void |
destroyToken(SSOToken token)
Destroys a single sign on token
|
void |
destroyToken(SSOToken destroyer,
SSOToken destroyed)
Destroys a single sign on token.
|
Set<SSOToken> |
getValidSessions(SSOToken requester,
String server)
Returns a list of single sign on token objects
which correspond to valid Sessions accessible to requester. single sign
on token objects returned are restricted: they can only be used to
retrieve properties and destroy sessions they represent.
|
boolean |
isIPValid(Session sess,
String clientIP)
Validate the IP address of the client with the IP stored in Session.
|
boolean |
isValidToken(SSOToken token)
Checks the validity of the single sign on token
|
boolean |
isValidToken(SSOToken token,
boolean refresh)
Checks the validity of the single sign on token
|
void |
logout(SSOToken token)
Logs out of the session underlying this SSOToken.
|
void |
refreshSession(SSOToken token)
Refresh the Session corresponding to the single sign on token from the
Session Server.
|
void |
refreshSession(SSOToken token,
boolean possiblyResetIdleTime)
Refresh the Session corresponding to the single sign on token from the
Session Server.
|
void |
validateToken(SSOToken token)
Checks if the single sign on token is valid.
|
public static Debug debug
public SSOProviderImpl() throws SSOException
SSOProviderImpl
SSOException
public SSOToken createSSOToken(javax.servlet.http.HttpServletRequest request) throws SSOException
HttpRequest
createSSOToken
in interface SSOProvider
request
- HttpServletRequest
SSOException
- if the single sign on token cannot be created.public SSOToken createSSOToken(Principal user, String password) throws SSOException, UnsupportedOperationException
createSSOToken
in interface SSOProvider
user
- Principal representing a user or servicepassword
- password string.SSOException
- if the single sign on token cannot be created.UnsupportedOperationException
- Thrown to indicate that the
requested operation is not supported.public SSOToken createSSOToken(String tokenId, boolean invokedByAuth) throws SSOException, UnsupportedOperationException
tokenId
- single sign on token ID.invokedByAuth
- boolean flag indicating that this method has
been invoked by the AuthContext.getSSOToken() API.SSOException
- if the single sign on token cannot be created.UnsupportedOperationException
- Thrown to indicate that the
requested operation is not supported.public SSOToken createSSOToken(String tokenId, boolean invokedByAuth, boolean possiblyResetIdleTime) throws SSOException, UnsupportedOperationException
createSSOToken
in interface SSOProvider
tokenId
- single sign on token ID.invokedByAuth
- boolean flag indicating that this method has been invoked by the AuthContext.getSSOToken()
API.possiblyResetIdleTime
- If true, the idle time of the token/session may be reset to zero. If false, the
idle time will never be reset.SSOException
- if the single sign on token cannot be created for any reason.UnsupportedOperationException
- only here to satisfy the interface, this is never thrown.public SSOToken createSSOToken(String tokenId) throws SSOException, UnsupportedOperationException
createSSOToken
in interface SSOProvider
tokenId
- single sign on token ID.SSOException
- if the single sign on token cannot be created.UnsupportedOperationException
public SSOToken createSSOToken(String tokenId, String clientIP) throws SSOException, UnsupportedOperationException
createSSOToken
in interface SSOProvider
tokenId
- single sign on token ID.clientIP
- client IP addressSSOException
- if the single sign on token cannot be created.UnsupportedOperationException
- Thrown to indicate that the
requested operation is not supported.public boolean isValidToken(SSOToken token)
isValidToken
in interface SSOProvider
token
- The single sign on token object to be validatedSSOToken
is validpublic boolean isValidToken(SSOToken token, boolean refresh)
isValidToken
in interface SSOProvider
token
- The single sign on token object to be validatedrefresh
- Flag indicating whether refreshing the token is allowedSSOToken
is valid, false otherwisepublic void validateToken(SSOToken token) throws SSOException
validateToken
in interface SSOProvider
token
- single sign on token.SSOException
- if the single sign on token is not valid.public void destroyToken(SSOToken token) throws SSOException
destroyToken
in interface SSOProvider
token
- The single sign on token object to be destroyedSSOException
- if the given token cannot be destroyedpublic void logout(SSOToken token) throws SSOException
SSOProvider
logout
in interface SSOProvider
token
- the sso token to log out.SSOException
- if an error occurs during logout.public boolean isIPValid(Session sess, String clientIP) throws SSOException
sess
- Session object associated with the tokenclientIP
- IP address of the current client who made
HttpRequest
.SSOException
- if IP cannot be validated for the given sessionpublic void refreshSession(SSOToken token) throws SSOException
refreshSession
in interface SSOProvider
token
- single sign on token for which session need to be refreshedSSOException
- if the session cannot be refreshedpublic void refreshSession(SSOToken token, boolean possiblyResetIdleTime) throws SSOException
refreshSession
in interface SSOProvider
token
- single sign on token for which session need to be refreshed.possiblyResetIdleTime
- if true, the idle time may be reset, if false it will never be.SSOException
- if the session cannot be refreshed.public void destroyToken(SSOToken destroyer, SSOToken destroyed) throws SSOException
destroyToken
in interface SSOProvider
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<SSOToken> getValidSessions(SSOToken requester, String server) throws SSOException
getValidSessions
in interface SSOProvider
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–2025 Open Identity Platform Community. All rights reserved.