Class AuthenticationInfo
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
Object>
AuthenticationInfo
conveys any authentication credentials
and/or details extracted by the
AuthenticationHandler.extractCredentials(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
method from the request.
AuthenticationHandler
implementations must return instances of this
class which may be constructed through any of the provided public
constructors.
Internally all values are stored in the map where some property names have
special semantics and the data type of the properties are ensured by the
put(String, Object)
method implementation.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Deprecated.The name of the special property providing the authentication type provided by theAuthenticationHandler
.static final String
Deprecated.The name of the property providing the JCR credentials.static final AuthenticationInfo
Deprecated.A special instance of this class which may be returned from theAuthenticationHandler.extractCredentials(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
method to inform the caller, that a response has been sent to the client to request for credentials.static final AuthenticationInfo
Deprecated.A special instance of this class which may be returned from theAuthenticationHandler.extractCredentials(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
method to inform the caller that credential extraction failed for some reason.static final String
Deprecated.The name of the property providing the password of the user on whose behalf the request is being handled.static final String
Deprecated.The name of the property providing the name of the user on whose behalf the request is being handled. -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationInfo
(String authType) Deprecated.Creates an instance of this class with just the authentication type.AuthenticationInfo
(String authType, String userId) Deprecated.Creates an instance of this class authenticating with the given type and userid.AuthenticationInfo
(String authType, String userId, char[] password) Deprecated.Creates an instance of this class authenticating with the given type and userid/password connecting. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Deprecated.Clears all properties from the map with the exception of theAUTH_TYPE
property.final String
Deprecated.Returns the authentication type stored as theAUTH_TYPE
property in this map.final char[]
Deprecated.Returns the password stored as thePASSWORD
property ornull
if the password is not set in this map.final String
getUser()
Deprecated.Returns the user name stored as theUSER
property ornull
if the user is not set in this map.Deprecated.Sets or resets a property with the givenkey
to a newvalue
.Deprecated.Removes the entry with the givenkey
and returns its former value (if existing).final void
setAuthType
(String authType) Deprecated.final void
setPassword
(char[] password) Deprecated.final void
Deprecated.Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Field Details
-
DOING_AUTH
Deprecated.A special instance of this class which may be returned from theAuthenticationHandler.extractCredentials(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
method to inform the caller, that a response has been sent to the client to request for credentials.If this value is returned, the request should be considered finished and no further actions should be taken on this request.
-
FAIL_AUTH
Deprecated.A special instance of this class which may be returned from theAuthenticationHandler.extractCredentials(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
method to inform the caller that credential extraction failed for some reason.If this value is returned, the handler signals that credentials would be present in the request but the credentials are not valid for use (for example OpenID identify failed to validate or some authentication cookie expired).
-
AUTH_TYPE
Deprecated.The name of the special property providing the authentication type provided by theAuthenticationHandler
. This value must be supplied to one of the constructors and is ultimately used as the value of theHttpServletRequest.getAuthType
method.This property is always present (and cannot be removed) in this map and is of
String
type.- See Also:
-
USER
Deprecated.The name of the property providing the name of the user on whose behalf the request is being handled. This property is set by theAuthenticationInfo(String, String, char[])
constructor and may benull
if this instance is created by either theAuthenticationInfo(String, String)
orAuthenticationInfo(String, String, char[])
constructors.The type of this property, if present, is
String
.- See Also:
-
PASSWORD
Deprecated.The name of the property providing the password of the user on whose behalf the request is being handled. This property is set by theAuthenticationInfo(String, String, char[])
constructor and may benull
if this instance is created by either theAuthenticationInfo(String, String)
orAuthenticationInfo(String, String, char[])
constructors.The type of this property, if present, is
char[]
.- See Also:
-
CREDENTIALS
Deprecated.The name of the property providing the JCR credentials. These credentials are preset to the credentials given to theAuthenticationInfo(String, String)
orAuthenticationInfo(String, String, char[])
constructors. is used the credentials property is set to a JCRSimpleCredentials
instance containing the user id and password passed to the constructor.- See Also:
-
-
Constructor Details
-
AuthenticationInfo
Deprecated.Creates an instance of this class with just the authentication type. To effectively use this instance the user Id with optional password and/or the credentials should be set.- Parameters:
authType
- The authentication type, must not benull
.
-
AuthenticationInfo
Deprecated.Creates an instance of this class authenticating with the given type and userid.- Parameters:
authType
- The authentication type, must not benull
.userId
- The name of the user to authenticate as. This may benull
for the constructor and later be set.- Throws:
NullPointerException
- ifauthType
isnull
.
-
AuthenticationInfo
Deprecated.Creates an instance of this class authenticating with the given type and userid/password connecting.- Parameters:
authType
- The authentication type, must not benull
.userId
- The name of the user to authenticate as. This may benull
for the constructor and later be set.password
- The password to authenticate with ornull
if no password can be supplied.- Throws:
NullPointerException
- ifauthType
isnull
.
-
-
Method Details
-
setAuthType
Deprecated.- Parameters:
authType
- The authentication type to set. If this isnull
the current authentication type is not replaced.
-
getAuthType
Deprecated.Returns the authentication type stored as theAUTH_TYPE
property in this map. This value is expected to never benull
.If authentication is taking place through one of the standard ways, such as Basic or Digest, the return value is one of the predefined constants of the
HttpServletRequest
interface. Otherwise the value may be specific to theAuthenticationHandler
implementation. -
setUser
Deprecated.- Parameters:
user
- The name of the user to authenticate as. If this isnull
the current user name is not replaced.
-
getUser
Deprecated.Returns the user name stored as theUSER
property ornull
if the user is not set in this map. -
setPassword
public final void setPassword(char[] password) Deprecated.- Parameters:
password
- The password to authenticate with. If this isnull
the current password is not replaced.
-
getPassword
public final char[] getPassword()Deprecated.Returns the password stored as thePASSWORD
property ornull
if the password is not set in this map. -
put
Deprecated.Sets or resets a property with the givenkey
to a newvalue
. Some keys have special meanings and their values are required to have predefined as listed in the following table:AUTH_TYPE
String
USER
String
PASSWORD
char[]
CREDENTIALS
javax.jcr.Credentials
If the value for the special key does not match the required type an
IllegalArgumentException
is thrown.- Specified by:
put
in interfaceMap<String,
Object> - Overrides:
put
in classHashMap<String,
Object> - Parameters:
key
- The name of the property to setvalue
- The value of the property which must be of a special type if thekey
designates one of the predefined properties.- Returns:
- The value previously set for the given
key
. - Throws:
IllegalArgumentException
- ifkey
designates one of the special properties and thevalue
does not have the correct type for the respective key.
-
remove
Deprecated.Removes the entry with the givenkey
and returns its former value (if existing). If thekey
isAUTH_TYPE
the value is not actually removed andnull
is always returned. -
clear
public void clear()Deprecated.Clears all properties from the map with the exception of theAUTH_TYPE
property.
-