Class AbstractDuoAuthenticator
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.authn.duo.impl.AbstractDuoAuthenticator
-
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent
- Direct Known Subclasses:
DuoAuthAuthenticator,DuoPreauthAuthenticator
@ThreadSafe public abstract class AbstractDuoAuthenticator extends AbstractInitializableComponent
A base class for authentication actions which call a Duo AuthAPI endpont.
-
-
Field Summary
Fields Modifier and Type Field Description private org.apache.http.client.HttpClienthttpClientHttpClient for contacting Duo.private HttpClientSecurityParametershttpClientSecurityParametersHTTP client security parameters.private com.fasterxml.jackson.databind.ObjectMapperobjectMapperJSON object mapper.
-
Constructor Summary
Constructors Constructor Description AbstractDuoAuthenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T extends DuoResponseWrapper<?>>
TdoAPIRequest(org.apache.http.client.methods.HttpUriRequest request, com.fasterxml.jackson.core.type.TypeReference<T> wrapperTypeRef)Performs a call to the Duo AuthAPI.protected voiddoInitialize()voidsetHttpClient(org.apache.http.client.HttpClient client)Set theHttpClientto use for contacting Duo.voidsetHttpClientSecurityParameters(HttpClientSecurityParameters params)Set the optional client security parameters.voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)Set the JSONObjectMapper.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
httpClient
@NonnullAfterInit private org.apache.http.client.HttpClient httpClient
HttpClient for contacting Duo.
-
httpClientSecurityParameters
@Nullable private HttpClientSecurityParameters httpClientSecurityParameters
HTTP client security parameters.
-
objectMapper
@NonnullAfterInit private com.fasterxml.jackson.databind.ObjectMapper objectMapper
JSON object mapper.
-
-
Method Detail
-
setHttpClient
public void setHttpClient(@Nonnull org.apache.http.client.HttpClient client)Set theHttpClientto use for contacting Duo.- Parameters:
client- HttpClient
-
setHttpClientSecurityParameters
public void setHttpClientSecurityParameters(@Nullable HttpClientSecurityParameters params)Set the optional client security parameters.- Parameters:
params- the new client security parameters
-
setObjectMapper
public void setObjectMapper(@Nonnull com.fasterxml.jackson.databind.ObjectMapper mapper)Set the JSONObjectMapper.- Parameters:
mapper- object mapper
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doAPIRequest
protected <T extends DuoResponseWrapper<?>> T doAPIRequest(@Nonnull org.apache.http.client.methods.HttpUriRequest request, @Nonnull com.fasterxml.jackson.core.type.TypeReference<T> wrapperTypeRef) throws com.duosecurity.duoweb.DuoWebException, org.apache.http.client.ClientProtocolException, IOException
Performs a call to the Duo AuthAPI. Upon a successful call, the JSON response is mapped into the appropriate type ofDuoResponseWrapper.- Type Parameters:
T- the DuoResponse type being wrapped- Parameters:
request- the prepared HTTP requestwrapperTypeRef- the type ofDuoResponseWrapperto use- Returns:
- a
DuoResponseWrapper - Throws:
IOException- on an I/O errororg.apache.http.client.ClientProtocolException- on an HTTP errorcom.duosecurity.duoweb.DuoWebException- on a Duo-related error
-
-