Class AbstractDuoAuthenticator
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.authn.duo.impl.AbstractDuoAuthenticator
-
- All Implemented Interfaces:
net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent
- Direct Known Subclasses:
DuoAuthAuthenticator,DuoPreauthAuthenticator
@ThreadSafe public abstract class AbstractDuoAuthenticator extends net.shibboleth.utilities.java.support.component.AbstractInitializableComponentA 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 org.opensaml.security.httpclient.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(org.opensaml.security.httpclient.HttpClientSecurityParameters params)Set the optional client security parameters.voidsetObjectMapper(com.fasterxml.jackson.databind.ObjectMapper mapper)Set the JSONObjectMapper.
-
-
-
Field Detail
-
httpClient
@NonnullAfterInit private org.apache.http.client.HttpClient httpClient
HttpClient for contacting Duo.
-
httpClientSecurityParameters
@Nullable private org.opensaml.security.httpclient.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 org.opensaml.security.httpclient.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 net.shibboleth.utilities.java.support.component.ComponentInitializationException- Overrides:
doInitializein classnet.shibboleth.utilities.java.support.component.AbstractInitializableComponent- Throws:
net.shibboleth.utilities.java.support.component.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
-
-