Class DuoSDKClientAdaptor
- java.lang.Object
-
- net.shibboleth.idp.plugin.authn.duo.AbstractDuoOIDCClient
-
- net.shibboleth.idp.plugin.authn.duo.sdk.impl.DuoSDKClientAdaptor
-
- All Implemented Interfaces:
DuoOIDCClient,DuoOIDCClientCapabilities
@ThreadSafe @Immutable public final class DuoSDKClientAdaptor extends AbstractDuoOIDCClient
An Object Adaptor class for bridging between the Duo SDK implementation and the internal
DuoOIDCClientinterface.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classDuoSDKClientAdaptor.DefaultHealthCheckResponseConverterDefault health check response converter.private classDuoSDKClientAdaptor.DefaultTokenResponseConverterDefault Duo token converter.
-
Field Summary
Fields Modifier and Type Field Description private com.duosecurity.ClientclientThe wrapped Duo native client.private DuoOIDCIntegrationduoIntegrationSave off the integration to help generate the JWT.private Function<com.duosecurity.model.HealthCheckResponse,DuoHealthCheck>healthCheckResponseConverterFunction to map the native DuoHealthCheckResponseobject to the interfaceDuoHealthCheckobject.private org.slf4j.LoggerlogClass logger.private BiFunction<com.duosecurity.model.Token,DuoOIDCIntegration,com.nimbusds.jwt.JWT>tokenResponseConverterFunction to map the native DuoTokenobject to the interfaceJWTobject.
-
Constructor Summary
Constructors Constructor Description DuoSDKClientAdaptor(DuoOIDCIntegration integration, List<String> caCerts)Package-private constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateAuthUrl(String username, String state, String nonce, String redirectURIOverride)com.nimbusds.jwt.JWTexchangeAuthorizationCodeFor2FAResult(String code, String username, String redirectURIOverride)DuoHealthCheckhealthCheck()booleanisSupportsNonce()-
Methods inherited from class net.shibboleth.idp.plugin.authn.duo.AbstractDuoOIDCClient
getCapabilities, getClientId
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
client
@Nonnull private final com.duosecurity.Client client
The wrapped Duo native client.
-
healthCheckResponseConverter
@Nonnull private final Function<com.duosecurity.model.HealthCheckResponse,DuoHealthCheck> healthCheckResponseConverter
Function to map the native DuoHealthCheckResponseobject to the interfaceDuoHealthCheckobject.
-
tokenResponseConverter
@Nonnull private final BiFunction<com.duosecurity.model.Token,DuoOIDCIntegration,com.nimbusds.jwt.JWT> tokenResponseConverter
Function to map the native DuoTokenobject to the interfaceJWTobject.
-
duoIntegration
@Nonnull private final DuoOIDCIntegration duoIntegration
Save off the integration to help generate the JWT.
-
-
Constructor Detail
-
DuoSDKClientAdaptor
DuoSDKClientAdaptor(@Nonnull DuoOIDCIntegration integration, @Nullable List<String> caCerts) throws DuoClientExceptionPackage-private constructor. Initialises the native Duo SDK client.Should only be instantiated by the
DuoSDKClientFactory.- Parameters:
integration- the Duo integration to initialize the client from. Nevernull.caCerts- the list of CA Certificates used to validate connections to Duo. Can benull.- Throws:
DuoClientException- if there is an error instantiating the client
-
-
Method Detail
-
healthCheck
@Nonnull public DuoHealthCheck healthCheck() throws DuoClientException
- Throws:
DuoClientException
-
createAuthUrl
@Nonnull public String createAuthUrl(@Nonnull @NotEmpty String username, @Nonnull @NotEmpty String state, @Nullable String nonce, @Nullable String redirectURIOverride) throws DuoClientException
The Duo WebSDK Client does not support either the
nonceorredirectURIOverrideparameters.- Throws:
DuoClientException
-
exchangeAuthorizationCodeFor2FAResult
@Nonnull public com.nimbusds.jwt.JWT exchangeAuthorizationCodeFor2FAResult(@Nonnull String code, @Nonnull String username, @Nullable String redirectURIOverride) throws DuoClientExceptionThe Duo WebSDK Client does not support the
redirectURIOverrideparameter.- Throws:
DuoClientException
-
isSupportsNonce
public boolean isSupportsNonce()
-
-