Package org.wildfly.security.auth.client
Class PeerIdentityContext
java.lang.Object
org.wildfly.security.auth.client.PeerIdentityContext
A peer identity context. The peer identity is relevant only to this context.
- Author:
- David M. Lloyd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract PeerIdentityauthenticate(AuthenticationConfiguration authenticationConfiguration) Authenticate a new peer identity.protected final <I> IconstructIdentity(Function<PeerIdentity.Configuration, I> constructFunction) Construct a new peer identity.Get the currently set peer identity for this context.final booleanowns(PeerIdentity identity) Determine whether this context owns the given identity.
-
Constructor Details
-
PeerIdentityContext
protected PeerIdentityContext()Construct a new instance.
-
-
Method Details
-
getCurrentIdentity
Get the currently set peer identity for this context.- Returns:
- the currently set peer identity for this context, or
nullif no identity is set
-
authenticate
public abstract PeerIdentity authenticate(AuthenticationConfiguration authenticationConfiguration) throws org.wildfly.security.auth.AuthenticationException Authenticate a new peer identity. The authentication operation may be deferred if the backend cannot perform authentications on demand. If so, and the authentication fails, aReauthenticationExceptionmay be thrown at a later time.- Parameters:
authenticationConfiguration- the authentication configuration to use- Returns:
- the peer identity
- Throws:
org.wildfly.security.auth.AuthenticationException- if an immediate authentication error occurs
-
constructIdentity
Construct a new peer identity. The given function uses the opaque one-time configuration object to construct the identity, which must be passed as-is to the constructor of thePeerIdentityclass. This object must not be retained or made available after the identity is constructed; such misuse may result in an exception or undefined behavior.- Parameters:
constructFunction- a function that, when applied, constructs a new peer identity- Returns:
- the constructed peer identity
-
owns
Determine whether this context owns the given identity.- Parameters:
identity- the identity- Returns:
trueif this context owns the identity,falseotherwise
-