Class NimbusClient

    • Field Detail

      • log

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

        @Nonnull
        private final DuoOIDCIntegration duoIntegration
        The integration to help generate the JWT.
      • httpClient

        @Nonnull
        private final org.apache.http.client.HttpClient httpClient
        HttpClient for contacting Duo.
      • httpClientSecurityParameters

        @Nullable
        private final HttpClientSecurityParameters httpClientSecurityParameters
        HTTP client security parameters.
      • objectMapper

        @Nonnull
        private final com.fasterxml.jackson.databind.ObjectMapper objectMapper
        JSON object mapper.
    • Constructor Detail

      • NimbusClient

        NimbusClient​(@Nonnull
                     DuoOIDCIntegration integration,
                     @Nonnull
                     org.apache.http.client.HttpClient client,
                     @Nullable
                     HttpClientSecurityParameters params,
                     @Nonnull
                     com.fasterxml.jackson.databind.ObjectMapper oMapper)
        Package-private Constructor.

        Should only be instantiated by the NimbusClientFactory.

        Parameters:
        integration - the integration to create the client for, never null
        client - the Http client to use to execute HTTP requests, never null
        params - any security parameters to use for the Http client, can be null.
        oMapper - the JSON object mapper, never null.
    • Method Detail

      • executeRequest

        private <T> T executeRequest​(@Nonnull
                                     org.apache.http.client.methods.HttpUriRequest request,
                                     @Nonnull
                                     com.fasterxml.jackson.core.type.TypeReference<T> wrapperTypeRef)
                              throws DuoClientException
        Performs a call to a Duo OIDC endpoint. Iff successful, the JSON response is mapped into the appropriate type.
        Type Parameters:
        T - the response type
        Parameters:
        request - the prepared HTTP request
        wrapperTypeRef - the type to deserialise the JSON into
        Returns:
        the response type, never null.
        Throws:
        DuoClientException - if there is an error producing a response
      • isSupportsNonce

        public boolean isSupportsNonce()