Class SimpleDuoOIDCIntegration
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.plugin.authn.duo.SimpleDuoOIDCIntegration
-
- All Implemented Interfaces:
PrincipalSupportingComponent,DuoOIDCIntegration,Component,DestructableComponent,InitializableComponent
@ThreadSafe public final class SimpleDuoOIDCIntegration extends AbstractInitializableComponent implements DuoOIDCIntegration
A data wrapper for use with Duo OIDC integrations which does not support redirectURI generation.
-
-
Field Summary
Fields Modifier and Type Field Description private StringapiHostAPI host.private StringauthorizeEndpointThe URL path to the authorization endpoint.private StringclientIdIntegration key.private StringhealthEndpointThe URL path to the health endpoint.private org.slf4j.LoggerlogClass logger.private StringredirectURIThe used (by clients) redirect_uri to send the client after authorisation .private StringsecretKeySecret key.private SubjectsupportedPrincipalsContainer for supported principals.private StringtokenEndpointThe URL path to the token endpoint.
-
Constructor Summary
Constructors Constructor Description SimpleDuoOIDCIntegration()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()booleanequals(Object obj)StringgetAPIHost()Get the name of the API host to contact.StringgetAuthorizeEndpoint()Get the path of the authorization endpoint.StringgetClientId()Get the clientId key.StringgetHealthCheckEndpoint()Get the path of the health check endpoint.StringgetRedirectURI()Get the runtime redirectURI to direct the client to after authorisation.StringgetSecretKey()Get the secret key.<T extends Principal>
Set<T>getSupportedPrincipals(Class<T> c)StringgetTokenEndpoint()Get the path of the token endpoint.inthashCode()voidsetAPIHost(String host)Set the API host to use.voidsetAuthorizeEndpoint(String endpoint)Set the authorize endpoint URL path.voidsetClientId(String id)Set the client ID to use.voidsetHealthCheckEndpoint(String endpoint)Set the health check endpoint URL path.voidsetRedirectURI(String url)Set the redirect URI.voidsetSecretKey(String key)Set the secret key to use.<T extends Principal>
voidsetSupportedPrincipals(Collection<T> principals)Set supported non-user-specific principals that the action will include in the subjects it generates, in place of any default principals from the flow.voidsetTokenEndpoint(String endpoint)Set the token endpoint URL path.StringtoString()-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Class logger.
-
apiHost
@NonnullAfterInit @NotEmpty private String apiHost
API host.
-
clientId
@NonnullAfterInit @NotEmpty private String clientId
Integration key.
-
secretKey
@NonnullAfterInit @NotEmpty private String secretKey
Secret key.
-
redirectURI
@Nullable private String redirectURI
The used (by clients) redirect_uri to send the client after authorisation .
-
healthEndpoint
@NonnullAfterInit @NotEmpty private String healthEndpoint
The URL path to the health endpoint.
-
authorizeEndpoint
@NonnullAfterInit @NotEmpty private String authorizeEndpoint
The URL path to the authorization endpoint.
-
tokenEndpoint
@NonnullAfterInit @NotEmpty private String tokenEndpoint
The URL path to the token endpoint.
-
supportedPrincipals
@Nonnull private final Subject supportedPrincipals
Container for supported principals.
-
-
Method Detail
-
getAPIHost
@NonnullAfterInit @NotEmpty public String getAPIHost()
Description copied from interface:DuoOIDCIntegrationGet the name of the API host to contact.- Specified by:
getAPIHostin interfaceDuoOIDCIntegration- Returns:
- name of API host
-
setAPIHost
public void setAPIHost(@Nonnull @NotEmpty String host)
Set the API host to use.- Parameters:
host- API host
-
getHealthCheckEndpoint
@NonnullAfterInit @NotEmpty public String getHealthCheckEndpoint()
Description copied from interface:DuoOIDCIntegrationGet the path of the health check endpoint.- Specified by:
getHealthCheckEndpointin interfaceDuoOIDCIntegration- Returns:
- the path of the health check endpoint
-
setHealthCheckEndpoint
public void setHealthCheckEndpoint(@Nonnull @NotEmpty String endpoint)
Set the health check endpoint URL path.- Parameters:
endpoint- the endpoint.
-
getAuthorizeEndpoint
@NonnullAfterInit @NotEmpty public String getAuthorizeEndpoint()
Description copied from interface:DuoOIDCIntegrationGet the path of the authorization endpoint.- Specified by:
getAuthorizeEndpointin interfaceDuoOIDCIntegration- Returns:
- the path of the authorization endpoint
-
setAuthorizeEndpoint
public void setAuthorizeEndpoint(@Nonnull @NotEmpty String endpoint)
Set the authorize endpoint URL path.- Parameters:
endpoint- the endpoint.
-
getTokenEndpoint
@NonnullAfterInit @NotEmpty public String getTokenEndpoint()
Description copied from interface:DuoOIDCIntegrationGet the path of the token endpoint.- Specified by:
getTokenEndpointin interfaceDuoOIDCIntegration- Returns:
- the path of the token endpoint;
-
setTokenEndpoint
public void setTokenEndpoint(@Nonnull @NotEmpty String endpoint)
Set the token endpoint URL path.- Parameters:
endpoint- the endpoint.
-
getRedirectURI
@Nullable public String getRedirectURI()
Description copied from interface:DuoOIDCIntegrationGet the runtime redirectURI to direct the client to after authorisation.- Specified by:
getRedirectURIin interfaceDuoOIDCIntegration- Returns:
- the redirectURI
-
setRedirectURI
public void setRedirectURI(@Nonnull String url)Set the redirect URI.- Parameters:
url- the url.
-
setClientId
public void setClientId(@Nonnull @NotEmpty String id)
Set the client ID to use.- Parameters:
id- the client identifier.
-
getClientId
@NonnullAfterInit @NotEmpty public String getClientId()
Description copied from interface:DuoOIDCIntegrationGet the clientId key.- Specified by:
getClientIdin interfaceDuoOIDCIntegration- Returns:
- the integration key
-
setSecretKey
public void setSecretKey(@Nonnull @NotEmpty String key)
Set the secret key to use.- Parameters:
key- secret key
-
getSecretKey
@NonnullAfterInit @NotEmpty public String getSecretKey()
Description copied from interface:DuoOIDCIntegrationGet the secret key.- Specified by:
getSecretKeyin interfaceDuoOIDCIntegration- Returns:
- the secret key
-
getSupportedPrincipals
@Nonnull @NonnullElements @Unmodifiable public <T extends Principal> Set<T> getSupportedPrincipals(@Nonnull Class<T> c)
- Specified by:
getSupportedPrincipalsin interfacePrincipalSupportingComponent
-
setSupportedPrincipals
public <T extends Principal> void setSupportedPrincipals(@Nullable @NonnullElements Collection<T> principals)
Set supported non-user-specific principals that the action will include in the subjects it generates, in place of any default principals from the flow.Setting to a null or empty collection will maintain the default behavior of relying on the flow.
- Type Parameters:
T- a type of principal to add, if not generic- Parameters:
principals- supported principals to include
-
doInitialize
protected void doInitialize() throws ComponentInitializationException- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
-