@PublicAPI(stability=UNCOMMITTED, mayInstantiate=true, mayInvoke=true) public final class AuthenticationInfo extends Object
Modifier and Type | Method and Description |
---|---|
static AuthenticationInfo |
anonymous()
Creates a new set of authentication information to be used for unauthenticated clients.
|
AuthenticationInfo |
duplicate(Entry newAuthenticationEntry,
Entry newAuthorizationEntry)
Creates a duplicate of this
AuthenticationInfo object with the new authentication and authorization
entries. |
Dn |
getAuthenticationDN()
Retrieves the DN of the user as whom the client is authenticated.
|
Entry |
getAuthenticationEntry()
Retrieves the entry for the user as whom the client is authenticated.
|
Dn |
getAuthorizationDN()
Retrieves the DN for the user that should be used as the default authorization identity.
|
Entry |
getAuthorizationEntry()
Retrieves the entry for the user that should be used as the default authorization identity.
|
boolean |
hasAuthenticationType(AuthenticationType authenticationType)
Indicates whether this client has authenticated using the specified authentication type.
|
boolean |
hasSASLMechanism(String saslMechanism)
Indicates whether the client is currently authenticated using the specified SASL mechanism.
|
static AuthenticationInfo |
internal(Entry authenticationEntry)
Creates a new set of authentication information to be used for clients that are authenticated internally.
|
boolean |
isAuthenticated()
Indicates whether this client has successfully authenticated to the server.
|
boolean |
mustChangePassword()
Indicates whether the authenticated user must change his/her password before any other operation will be allowed.
|
static AuthenticationInfo |
sasl(Entry authenticationEntry,
Entry authorizationEntry,
String saslMechanism)
Creates a new set of authentication information to be used for clients that have authenticated using a SASL
mechanism.
|
static AuthenticationInfo |
sasl(Entry authenticationEntry,
String saslMechanism)
Creates a new set of authentication information to be used for clients that have authenticated using a SASL
mechanism.
|
void |
setAuthenticationDN(Dn dn)
Sets the DN of the user as whom the client is authenticated, does nothing if the client is unauthenticated.
|
void |
setAuthorizationDN(Dn dn)
Sets the DN for the user that should be used as the default authorization identity, does nothing if the client is
unauthorized.
|
void |
setMustChangePassword(boolean mustChangePassword)
Specifies whether the authenticated user must change his/her password before any other operation will be allowed.
|
static AuthenticationInfo |
simple(Entry authenticationEntry)
Creates a new set of authentication information to be used for clients that have successfully performed simple
authentication.
|
String |
toString()
Retrieves a string representation of this authentication info structure.
|
public static AuthenticationInfo anonymous()
public static AuthenticationInfo internal(Entry authenticationEntry)
authenticationEntry
- The entry of the user that has authenticated, or null
to indicate an unauthenticated user.public static AuthenticationInfo simple(Entry authenticationEntry)
authenticationEntry
- The entry of the user that has authenticated. It must not be null
.public static AuthenticationInfo sasl(Entry authenticationEntry, String saslMechanism)
authenticationEntry
- The entry of the user that has authenticated. It must not be null
.saslMechanism
- The SASL mechanism used to authenticate. This must be provided in all-uppercase characters and must
not be null
.public static AuthenticationInfo sasl(Entry authenticationEntry, Entry authorizationEntry, String saslMechanism)
authenticationEntry
- The entry of the user that has authenticated. It must not be null
.authorizationEntry
- The entry of the user that will be used as the default authorization identity, or null
to
indicate that the authorization identity should be the unauthenticated user.saslMechanism
- The SASL mechanism used to authenticate. This must be provided in all-uppercase characters and must
not be null
.public boolean isAuthenticated()
true
if this client has successfully authenticated to the server, or false
if not.public boolean mustChangePassword()
true
if the user must change his/her password before any other operation will be allowed, or
false
if not.public void setMustChangePassword(boolean mustChangePassword)
mustChangePassword
- Specifies whether the authenticated user must change his/her password before any other operation will
be allowed.public boolean hasAuthenticationType(AuthenticationType authenticationType)
authenticationType
- The authentication type for which to make the determination.true
if the client has authenticated using the specified authentication type, or false
if
not.public Entry getAuthenticationEntry()
null
if the client is
unauthenticated.public Dn getAuthenticationDN()
null
if the client is unauthenticated.public void setAuthenticationDN(Dn dn)
dn
- authentication identity DN.public Entry getAuthorizationEntry()
null
if the
authorization identity should be the unauthenticated user.public Dn getAuthorizationDN()
null
if the
authorization identity should be the unauthenticated user.public void setAuthorizationDN(Dn dn)
dn
- authorization identity DN.public boolean hasSASLMechanism(String saslMechanism)
saslMechanism
- The SASL mechanism for which to make the determination. Note that this must be provided in all
uppercase characters.true
if the client is authenticated using the specified SASL mechanism, or false
if not.public String toString()
public AuthenticationInfo duplicate(Entry newAuthenticationEntry, Entry newAuthorizationEntry)
AuthenticationInfo
object with the new authentication and authorization
entries.newAuthenticationEntry
- The updated entry for the user as whom the associated client connection is authenticated.newAuthorizationEntry
- The updated entry for the default authorization identity for the associated client connection.AuthenticationInfo
object with the specified authentication and
authorization entries.Copyright 2010-2018 ForgeRock AS.