Package net.shibboleth.idp.authn.duo
Class BasicDuoIntegration
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- net.shibboleth.idp.authn.duo.BasicDuoIntegration
-
- All Implemented Interfaces:
DuoIntegration,PrincipalSupportingComponent,Component,DestructableComponent,InitializableComponent
public class BasicDuoIntegration extends AbstractInitializableComponent implements DuoIntegration
Wrapper for use of Duo.- Since:
- 3.3.0
-
-
Field Summary
Fields Modifier and Type Field Description private StringapiHostAPI host.private StringapplicationKeyApplication key.private StringintegrationKeyIntegration key.private StringsecretKeySecret key.private SubjectsupportedPrincipalsContainer for supported principals.
-
Constructor Summary
Constructors Constructor Description BasicDuoIntegration()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()StringgetAPIHost()Get the name of the API host to contact.StringgetApplicationKey()Get the application key.StringgetIntegrationKey()Get the integration key.StringgetSecretKey()Get the secret key.<T extends Principal>
Set<T>getSupportedPrincipals(Class<T> c)Get an immutable set of supported custom principals that the component produces, supports, contains, etc.voidsetAPIHost(String host)Set the API host to use.voidsetApplicationKey(String key)Set the application key to use.voidsetIntegrationKey(String key)Set the integration key to use.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.-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
apiHost
@NonnullAfterInit @NotEmpty private String apiHost
API host.
-
integrationKey
@NonnullAfterInit @NotEmpty private String integrationKey
Integration key.
-
secretKey
@NonnullAfterInit @NotEmpty private String secretKey
Secret key.
-
supportedPrincipals
@Nonnull private final Subject supportedPrincipals
Container for supported principals.
-
-
Method Detail
-
getAPIHost
@Nonnull @NotEmpty public String getAPIHost()
Get the name of the API host to contact.- Specified by:
getAPIHostin interfaceDuoIntegration- Returns:
- name of API host
-
setAPIHost
public void setAPIHost(@Nonnull @NotEmpty String host)
Set the API host to use.- Parameters:
host- API host
-
getApplicationKey
@Nullable @NotEmpty public String getApplicationKey()
Get the application key.- Specified by:
getApplicationKeyin interfaceDuoIntegration- Returns:
- the application key
-
setApplicationKey
public void setApplicationKey(@Nullable @NotEmpty String key)
Set the application key to use.- Parameters:
key- application key
-
getIntegrationKey
@Nonnull @NotEmpty public String getIntegrationKey()
Get the integration key.- Specified by:
getIntegrationKeyin interfaceDuoIntegration- Returns:
- the integration key
-
setIntegrationKey
public void setIntegrationKey(@Nonnull @NotEmpty String key)
Set the integration key to use.- Parameters:
key- integration key
-
getSecretKey
@Nonnull @NotEmpty public String getSecretKey()
Get the secret key.- Specified by:
getSecretKeyin interfaceDuoIntegration- Returns:
- the secret key
-
setSecretKey
public void setSecretKey(@Nonnull @NotEmpty String key)
Set the secret key to use.- Parameters:
key- secret key
-
getSupportedPrincipals
@Nonnull @NonnullElements @Unmodifiable public <T extends Principal> Set<T> getSupportedPrincipals(@Nonnull Class<T> c)
Get an immutable set of supported custom principals that the component produces, supports, contains, etc.- Specified by:
getSupportedPrincipalsin interfacePrincipalSupportingComponent- Type Parameters:
T- type of Principal to inquire on- Parameters:
c- type of Principal to inquire on- Returns:
- a set of matching principals
-
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
-
-