Class 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 Details

  • Constructor Details

    • BasicDuoIntegration

      public BasicDuoIntegration()
      Constructor.
  • Method Details

    • getAPIHost

      @Nonnull @NotEmpty public String getAPIHost()
      Get the name of the API host to contact.
      Specified by:
      getAPIHost in interface DuoIntegration
      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:
      getApplicationKey in interface DuoIntegration
      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:
      getIntegrationKey in interface DuoIntegration
      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:
      getSecretKey in interface DuoIntegration
      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:
      getSupportedPrincipals in interface PrincipalSupportingComponent
      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:
      doInitialize in class AbstractInitializableComponent
      Throws:
      ComponentInitializationException