Top Description Fields Constructors Methods
org.apache.catalina.authenticator

public Class SingleSignOnEntry

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.IOException, .ObjectInputStream, .ObjectOutputStream, .Serializable, java.security.Principal, java.util.Map, .Set, java.util.concurrent.ConcurrentHashMap, jakarta.servlet.http.HttpServletRequest, org.apache.catalina.Session

A class that represents entries in the cache of authenticated users. This is necessary to make it available to AuthenticatorBase subclasses that need it in order to perform reauthentications when SingleSignOn is in use.
Author
B Stansberry, based on work by Craig R. McClanahan
See Also
SingleSignOn, AuthenticatorBase#reauthenticateFromSSO

Field Summary

Modifier and TypeField and Description
private String
private boolean
private String
private transient Principal
private static final long
private final Map<SingleSignOnSessionKey, SingleSignOnSessionKey>
private String

Constructor Summary

AccessConstructor and Description
public
SingleSignOnEntry(Principal
the Principal returned by the latest call to Realm.authenticate.
principal
,
String
the type of authenticator used (BASIC, CLIENT_CERT, DIGEST or FORM)
authType
,
String
the username (if any) used for the authentication
username
,
String
the password (if any) used for the authentication
password
)

Creates a new SingleSignOnEntry

Method Summary

Modifier and TypeMethod and Description
public void
addSession(SingleSignOn
The SingleSignOn valve that is managing the SSO session.
sso
,
String
The ID of the SSO session.
ssoId
,
Session
The Session being associated with the SSO.
session
)

Adds a Session to the list of those associated with this SSO.

public Set<SingleSignOnSessionKey>

Returns:

The identifiers for the HTTP sessions that are current associated with this SSo entry
findSessions
()

Returns the HTTP Session identifiers associated with this SSO.

public String

Returns:

"BASIC", "CLIENT_CERT", "DIGEST", "FORM" or "NONE"
getAuthType
()

Gets the name of the authentication type originally used to authenticate the user associated with the SSO.

public boolean

Returns:

true if getAuthType returns "BASIC" or "FORM", false otherwise.
getCanReauthenticate
()

Gets whether the authentication type associated with the original authentication supports reauthentication.

public String

Returns:

the password credential associated with the SSO, or null if the original authentication type does not involve a password.
getPassword
()

Gets the password credential (if any) associated with the SSO.

public Principal

Returns:

The Principal that was created by the authentication that triggered the creation of the SSO entry
getPrincipal
()

Gets the Principal that has been authenticated by the SSO.

public String

Returns:

The user name that was authenticated as part of the authentication that triggered the creation of the SSO entry
getUsername
()

Gets the user name provided by the user as part of the authentication process.

private void
public void
removeSession(Session
the Session to remove.
session
)

Removes the given Session from the list of those associated with this SSO.

public synchronized void
updateCredentials(Principal
the Principal returned by the latest call to Realm.authenticate.
principal
,
String
the type of authenticator used (BASIC, CLIENT_CERT, DIGEST or FORM)
authType
,
String
the username (if any) used for the authentication
username
,
String
the password (if any) used for the authentication
password
)

Updates the SingleSignOnEntry to reflect the latest security information associated with the caller.

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

authTypeback to summary
private String authType
canReauthenticateback to summary
private boolean canReauthenticate
passwordback to summary
private String password
principalback to summary
private transient Principal principal
serialVersionUIDback to summary
private static final long serialVersionUID
sessionKeysback to summary
private final Map<SingleSignOnSessionKey, SingleSignOnSessionKey> sessionKeys
usernameback to summary
private String username

Constructor Detail

SingleSignOnEntryback to summary
public SingleSignOnEntry(Principal principal, String authType, String username, String password)

Creates a new SingleSignOnEntry

Parameters
principal:Principal

the Principal returned by the latest call to Realm.authenticate.

authType:String

the type of authenticator used (BASIC, CLIENT_CERT, DIGEST or FORM)

username:String

the username (if any) used for the authentication

password:String

the password (if any) used for the authentication

Method Detail

addSessionback to summary
public void addSession(SingleSignOn sso, String ssoId, Session session)

Adds a Session to the list of those associated with this SSO.

Parameters
sso:SingleSignOn

The SingleSignOn valve that is managing the SSO session.

ssoId:String

The ID of the SSO session.

session:Session

The Session being associated with the SSO.

findSessionsback to summary
public Set<SingleSignOnSessionKey> findSessions()

Returns the HTTP Session identifiers associated with this SSO.

Returns:Set<SingleSignOnSessionKey>

The identifiers for the HTTP sessions that are current associated with this SSo entry

getAuthTypeback to summary
public String getAuthType()

Gets the name of the authentication type originally used to authenticate the user associated with the SSO.

Returns:String

"BASIC", "CLIENT_CERT", "DIGEST", "FORM" or "NONE"

getCanReauthenticateback to summary
public boolean getCanReauthenticate()

Gets whether the authentication type associated with the original authentication supports reauthentication.

Returns:boolean

true if getAuthType returns "BASIC" or "FORM", false otherwise.

getPasswordback to summary
public String getPassword()

Gets the password credential (if any) associated with the SSO.

Returns:String

the password credential associated with the SSO, or null if the original authentication type does not involve a password.

getPrincipalback to summary
public Principal getPrincipal()

Gets the Principal that has been authenticated by the SSO.

Returns:Principal

The Principal that was created by the authentication that triggered the creation of the SSO entry

getUsernameback to summary
public String getUsername()

Gets the user name provided by the user as part of the authentication process.

Returns:String

The user name that was authenticated as part of the authentication that triggered the creation of the SSO entry

readObjectback to summary
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
removeSessionback to summary
public void removeSession(Session session)

Removes the given Session from the list of those associated with this SSO.

Parameters
session:Session

the Session to remove.

updateCredentialsback to summary
public synchronized void updateCredentials(Principal principal, String authType, String username, String password)

Updates the SingleSignOnEntry to reflect the latest security information associated with the caller.

Parameters
principal:Principal

the Principal returned by the latest call to Realm.authenticate.

authType:String

the type of authenticator used (BASIC, CLIENT_CERT, DIGEST or FORM)

username:String

the username (if any) used for the authentication

password:String

the password (if any) used for the authentication

writeObjectback to summary
private void writeObject(ObjectOutputStream out) throws IOException