Class NimbusClient
java.lang.Object
net.shibboleth.idp.plugin.authn.duo.AbstractDuoOIDCClient
net.shibboleth.idp.plugin.authn.duo.nimbus.impl.NimbusClient
- All Implemented Interfaces:
DuoOIDCClient,DuoOIDCClientCapabilities
A Duo client using the Nimbus OIDC library.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringThe only supported client assertion type.private final DuoOIDCIntegrationThe integration to help generate the JWT.private final org.apache.hc.client5.http.classic.HttpClientHttpClient for contacting Duo.private final HttpClientSecurityParametersHTTP client security parameters.private static final StringThe HTTPS scheme.private final org.slf4j.LoggerClass logger.private final com.fasterxml.jackson.databind.ObjectMapperJSON object mapper. -
Constructor Summary
ConstructorsConstructorDescriptionNimbusClient(DuoOIDCIntegration integration, org.apache.hc.client5.http.classic.HttpClient client, HttpClientSecurityParameters params, com.fasterxml.jackson.databind.ObjectMapper oMapper) Package-private Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncreateAuthUrl(String username, String state, String nonce, String redirectURIOverride) com.nimbusds.jwt.JWTexchangeAuthorizationCodeFor2FAResult(String code, String username, String redirectURIOverride) private <T> TexecuteRequest(org.apache.hc.core5.http.ClassicHttpRequest request, com.fasterxml.jackson.core.type.TypeReference<T> wrapperTypeRef) Performs a call to a Duo OIDC endpoint.booleanMethods inherited from class net.shibboleth.idp.plugin.authn.duo.AbstractDuoOIDCClient
getCapabilities, getClientId
-
Field Details
-
CLIENT_ASSERTION_TYPE
The only supported client assertion type.- See Also:
-
HTTPS
The HTTPS scheme.- See Also:
-
log
@Nonnull private final org.slf4j.Logger logClass logger. -
duoIntegration
The integration to help generate the JWT. -
httpClient
@Nonnull private final org.apache.hc.client5.http.classic.HttpClient httpClientHttpClient for contacting Duo. -
httpClientSecurityParameters
HTTP client security parameters. -
objectMapper
@Nonnull private final com.fasterxml.jackson.databind.ObjectMapper objectMapperJSON object mapper.
-
-
Constructor Details
-
NimbusClient
NimbusClient(@Nonnull DuoOIDCIntegration integration, @Nonnull org.apache.hc.client5.http.classic.HttpClient client, @Nullable HttpClientSecurityParameters params, @Nonnull com.fasterxml.jackson.databind.ObjectMapper oMapper) Package-private Constructor.Should only be instantiated by the
NimbusClientFactory.- Parameters:
integration- the integration to create the client for, nevernullclient- the Http client to use to execute HTTP requests, nevernullparams- any security parameters to use for the Http client, can benull.oMapper- the JSON object mapper, nevernull.
-
-
Method Details
-
healthCheck
- Throws:
DuoClientException
-
createAuthUrl
@Nonnull public String createAuthUrl(@Nonnull @NotEmpty String username, @Nonnull @NotEmpty String state, @Nullable String nonce, @Nullable String redirectURIOverride) throws DuoClientException - Throws:
DuoClientException
-
exchangeAuthorizationCodeFor2FAResult
public com.nimbusds.jwt.JWT exchangeAuthorizationCodeFor2FAResult(@Nonnull String code, @Nonnull String username, @Nullable String redirectURIOverride) throws DuoClientException - Throws:
DuoClientException
-
executeRequest
@Nonnull private <T> T executeRequest(@Nonnull org.apache.hc.core5.http.ClassicHttpRequest request, @Nonnull com.fasterxml.jackson.core.type.TypeReference<T> wrapperTypeRef) throws DuoClientException Performs a call to a Duo OIDC endpoint. Iff successful, the JSON response is mapped into the appropriate type.- Type Parameters:
T- the response type- Parameters:
request- the prepared HTTP requestwrapperTypeRef- the type to deserialise the JSON into- Returns:
- the response type, never
null. - Throws:
DuoClientException- if there is an error producing a response
-
isSupportsNonce
public boolean isSupportsNonce()
-