Package org.opends.server.types
Record Class AuthenticationInfo
java.lang.Object
java.lang.Record
org.opends.server.types.AuthenticationInfo
- Record Components:
authenticationEntry- The entry of the user that is currently authenticated, ornullif the client is unauthenticated.- The entry of the user that will be used as the default authorization identity, ornullif the authorization identity should be the unauthenticated userauthenticationType- The type of authentication performed on this connectionsaslMechanism- The uppercased SASL mechanism used to authenticate.
public record AuthenticationInfo(Entry authenticationEntry, Entry authorizationEntry, AuthenticationType authenticationType, String saslMechanism)
extends Record
This class defines a data structure that may be used to store information about an authenticated user. Note that
structures in this class allow for multiple authentication types for the same user, which is not currently supported
by LDAP but may be offered through some type of extension.
-
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationInfo(Entry authenticationEntry, Entry authorizationEntry, AuthenticationType authenticationType, String saslMechanism) Builds an AuthenticationInfo object. -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationInfoCreates a new set of authentication information to be used for unauthenticated clients.Returns the value of theauthenticationEntryrecord component.Returns the value of theauthenticationTyperecord component.Returns the value of theauthorizationEntryrecord component.Creates a duplicate of thisAuthenticationInfoobject with the new authentication and authorization entries.final booleanIndicates whether some other object is "equal to" this one.Retrieves the DN of the user as whom the client is authenticated.Retrieves the DN for the user that should be used as the default authorization identity.final inthashCode()Returns a hash code value for this object.static AuthenticationInfoCreates a new set of authentication information to be used for clients that are authenticated internally.booleanIndicates whether this client has successfully authenticated to the server.static AuthenticationInfoCreates a new set of authentication information to be used for clients that have authenticated using a SASL mechanism.static AuthenticationInfoCreates a new set of authentication information to be used for clients that have authenticated using a SASL mechanism.Returns the value of thesaslMechanismrecord component.voidSets the DN of the user as whom the client is authenticated, does nothing if the client is unauthenticated.voidsetAuthorizationDN(Dn dn) Sets the DN for the user that should be used as the default authorization identity, does nothing if the client is unauthorized.static AuthenticationInfoCreates a new set of authentication information to be used for clients that have successfully performed simple authentication.toString()Retrieves a string representation of this authentication info structure.
-
Constructor Details
-
AuthenticationInfo
public AuthenticationInfo(Entry authenticationEntry, Entry authorizationEntry, AuthenticationType authenticationType, String saslMechanism) Builds an AuthenticationInfo object.
-
-
Method Details
-
anonymous
Creates a new set of authentication information to be used for unauthenticated clients.- Returns:
- The new authentication information.
-
internal
Creates a new set of authentication information to be used for clients that are authenticated internally.- Parameters:
authenticationEntry- The entry of the user that has authenticated, ornullto indicate an unauthenticated user.- Returns:
- The new authentication information.
-
simple
Creates a new set of authentication information to be used for clients that have successfully performed simple authentication.- Parameters:
authenticationEntry- The entry of the user that has authenticated. It must not benull.- Returns:
- The new authentication information.
-
sasl
Creates a new set of authentication information to be used for clients that have authenticated using a SASL mechanism.- Parameters:
authenticationEntry- The entry of the user that has authenticated. It must not benull.saslMechanism- The SASL mechanism used to authenticate. This must be provided in all-uppercase characters and must not benull.- Returns:
- The new authentication information.
-
sasl
public 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.- Parameters:
authenticationEntry- The entry of the user that has authenticated. It must not benull.authorizationEntry- The entry of the user that will be used as the default authorization identity, ornullto 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 benull.- Returns:
- The new authentication information.
-
isAuthenticated
public boolean isAuthenticated()Indicates whether this client has successfully authenticated to the server.- Returns:
trueif this client has successfully authenticated to the server, orfalseif not.
-
getAuthenticationDN
Retrieves the DN of the user as whom the client is authenticated.- Returns:
- The DN of the user as whom the client is authenticated, or
nullif the client is unauthenticated.
-
setAuthenticationDN
Sets the DN of the user as whom the client is authenticated, does nothing if the client is unauthenticated.- Parameters:
dn- authentication identity DN.
-
getAuthorizationDN
Retrieves the DN for the user that should be used as the default authorization identity.- Returns:
- The DN for the user that should be used as the default authorization identity, or
nullif the authorization identity should be the unauthenticated user.
-
setAuthorizationDN
Sets the DN for the user that should be used as the default authorization identity, does nothing if the client is unauthorized.- Parameters:
dn- authorization identity DN.
-
toString
Retrieves a string representation of this authentication info structure. -
duplicate
Creates a duplicate of thisAuthenticationInfoobject with the new authentication and authorization entries.- Parameters:
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.- Returns:
- The duplicate of this
AuthenticationInfoobject with the specified authentication and authorization entries.
-
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
authenticationEntry
Returns the value of theauthenticationEntryrecord component.- Returns:
- the value of the
authenticationEntryrecord component
-
authorizationEntry
Returns the value of theauthorizationEntryrecord component.- Returns:
- the value of the
authorizationEntryrecord component
-
authenticationType
Returns the value of theauthenticationTyperecord component.- Returns:
- the value of the
authenticationTyperecord component
-
saslMechanism
Returns the value of thesaslMechanismrecord component.- Returns:
- the value of the
saslMechanismrecord component
-