Class DuoSDKClientFactory

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.plugin.authn.duo.sdk.impl.DuoSDKClientFactory
All Implemented Interfaces:
DuoOIDCClientFactory, Component, DestructableComponent, InitializableComponent

@ThreadSafe public final class DuoSDKClientFactory extends AbstractInitializableComponent implements DuoOIDCClientFactory
Abstract factory implementation for the DuoSDKClientAdaptor.
  • Field Details

    • log

      @Nonnull private static final org.slf4j.Logger log
      Class logger.
    • caCerts

      @Nullable @NonnullElements @Unmodifiable private List<String> caCerts
      List of CA Certificate pins. If null, the client's default set are used.
    • proxyHost

      @Nullable @NotEmpty private String proxyHost
      The optional HTTP proxy hostname.
    • proxyPort

      @Nullable private Integer proxyPort
      The optional HTTP proxy port number.
  • Constructor Details

    • DuoSDKClientFactory

      public DuoSDKClientFactory()
  • Method Details

    • setCaCerts

      @Deprecated(since="2.4.0", forRemoval=true) public void setCaCerts(@Nullable List<String> certs)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the list of CA certificate pins used to verify the Duo client connection to the API host. If null, the client will use the internal defaults.
      Parameters:
      certs - the list of certificate pins.
    • setPinnedCertificates

      public void setPinnedCertificates(@Nullable List<Resource> certResources)
      Set the resources which we will convert into PEM encoded strings.
      Parameters:
      certResources - the resources
    • validateCertificate

      private static void validateCertificate(@Nonnull String certificate)
      Check the certificate strings is a valid X.509 certificates, and not, for example, a public key pin.
      Parameters:
      certificate - the certificate to check
    • getCaCerts

      @Nullable @NonnullElements @Unmodifiable private List<String> getCaCerts()
      Get the caCerts, guarded by this objects monitor.
      Returns:
      the caCerts.
    • setProxyHost

      public void setProxyHost(@Nullable @NotEmpty String host)
      Set the HTTP proxy host, guarded by this objects monitor.
      Parameters:
      host - the proxy host to set.
      Since:
      2.2.0
    • getProxyHost

      @Nullable @NotEmpty private String getProxyHost()
      Get the HTTP proxy host, guarded by this objects monitor.
      Returns:
      the proxy host.
      Since:
      2.2.0
    • setProxyPort

      public void setProxyPort(@Nullable Integer port)
      Set the HTTP proxy port, guarded by this objects monitor.
      Parameters:
      port - the proxy port to set.
      Since:
      2.2.0
    • getProxyPort

      @Nullable private Integer getProxyPort()
      Get the HTTP proxy port, guarded by this objects monitor.
      Returns:
      the proxy port.
      Since:
      2.2.0
    • createInstance

      @Nonnull public DuoOIDCClient createInstance(@Nonnull DuoOIDCIntegration integration) throws DuoClientException
      Description copied from interface: DuoOIDCClientFactory
      Create an DuoOIDCClient instance from the supplied integration.

      The client should be fully initialised and safely published.

      Specified by:
      createInstance in interface DuoOIDCClientFactory
      Parameters:
      integration - the duo integration used to instantiate the client.
      Returns:
      the created Duo client, never null.
      Throws:
      DuoClientException - if there is an error creating the Duo client.