Class DuoOIDCAuthenticationContext
java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.plugin.authn.duo.context.DuoOIDCAuthenticationContext
- All Implemented Interfaces:
Iterable<BaseContext>
Mutable Context that carries the Duo integration, request-response state, authorization code, and Duo authentication result token.
As with other context classes, holds state, is not thread-safe and should be thread-confined.
- Parent:
AuthenticationContext- Added:
- After extracting the Duo integration for the given authentication request.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext
BaseContext.ContextSetNoRemoveIteratorDecorator, BaseContext.DeprecatedContextClassNameLookAside -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe authorization code return from the Duo authorization request.private com.nimbusds.jwt.JWTThe JWT token received from Duo as a result of 2FA.private DuoOIDCClientThe Duo OIDC client to use for the lifetime of this authentication request.private DuoOIDCIntegrationThe selected Duo integration to use for the lifetime of this request.private StringString value used to associate a Client session with an ID Token to mitigate replay attacks.private StringA request-bound redirect URI that was determined at runtime.private StringA randomly generated 32 character minimum String sent in the Duo 2FA authorization request.private StringA randomly generated 32 character minimum String returned in the Duo 2FA authorization response.private StringUsername. -
Constructor Summary
ConstructorsConstructorDescriptionPublic no-arg constructor to allow auto-creation. -
Method Summary
Modifier and TypeMethodDescriptionGet the authorization code.com.nimbusds.jwt.JWTGet the Duo authentication token.Get the client used to communicate with the Duo OIDC API.Get the Duo integration.getNonce()Get the nonce.Get the override redirect URI.Get the request state.Get the response state.Get the username.setAuthorizationCode(String code) Set the authorization code.setAuthToken(com.nimbusds.jwt.JWT token) Set the Duo authentication token.setClient(DuoOIDCClient duoClient) Set the client used to communicate with the Duo OIDC API.setIntegration(DuoOIDCIntegration duoIntegration) Set the Duo integration.Set the OIDC nonce.setRedirectURIOverride(String override) Set the override redirect URI.setRequestState(String state) Set the request state.setResponseState(String state) Set the response state.setUsername(String name) Set the username.Methods inherited from class org.opensaml.messaging.context.BaseContext
addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, ensureSubcontext, ensureSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeFromParent, removeSubcontext, removeSubcontext, setParentMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
username
Username. -
integration
The selected Duo integration to use for the lifetime of this request. -
requestState
A randomly generated 32 character minimum String sent in the Duo 2FA authorization request. -
responseState
A randomly generated 32 character minimum String returned in the Duo 2FA authorization response. -
nonce
String value used to associate a Client session with an ID Token to mitigate replay attacks. -
authCode
The authorization code return from the Duo authorization request. -
authToken
@Nullable private com.nimbusds.jwt.JWT authTokenThe JWT token received from Duo as a result of 2FA. Token *must* be signed. -
client
The Duo OIDC client to use for the lifetime of this authentication request. -
redirectURIOverride
A request-bound redirect URI that was determined at runtime. Used to override the URI inside aDuoOIDCIntegrationfor supported clients. Allows per-request redirects e.g. useful if one IdP instance is fronted by different virtual hosts.
-
-
Constructor Details
-
DuoOIDCAuthenticationContext
public DuoOIDCAuthenticationContext()Public no-arg constructor to allow auto-creation.
-
-
Method Details
-
getRedirectURIOverride
Get the override redirect URI.- Returns:
- the override redirect URI.
-
setRedirectURIOverride
Set the override redirect URI.- Parameters:
override- the override redirect URI.- Returns:
- this context.
-
getNonce
Get the nonce.- Returns:
- the nonce.
-
setNonce
Set the OIDC nonce.- Parameters:
oidcNonce- the nonce.- Returns:
- this context.
-
getAuthorizationCode
Get the authorization code.- Returns:
- the authorization code.
-
setAuthorizationCode
Set the authorization code.- Parameters:
code- the authorization code.- Returns:
- this context.
-
getClient
Get the client used to communicate with the Duo OIDC API.- Returns:
- the duo client.
-
setClient
Set the client used to communicate with the Duo OIDC API.- Parameters:
duoClient- the duo client.- Returns:
- this context.
-
setAuthToken
Set the Duo authentication token.- Parameters:
token- the duo authentication token- Returns:
- this context
-
getAuthToken
@Nullable public com.nimbusds.jwt.JWT getAuthToken()Get the Duo authentication token.- Returns:
- the token
-
getRequestState
Get the request state.- Returns:
- the state
-
setRequestState
Set the request state.- Parameters:
state- the state.- Returns:
- this context
-
getResponseState
Get the response state.- Returns:
- the state
-
setResponseState
Set the response state.- Parameters:
state- the state.- Returns:
- this context
-
getUsername
Get the username.- Returns:
- username
-
setUsername
Set the username.- Parameters:
name- username- Returns:
- this context
-
setIntegration
@Nonnull public DuoOIDCAuthenticationContext setIntegration(@Nullable DuoOIDCIntegration duoIntegration) Set the Duo integration.- Parameters:
duoIntegration- the integration- Returns:
- this context
-
getIntegration
Get the Duo integration.- Returns:
- the Duo integration
-