Class AuthenticationSupport


  • public class AuthenticationSupport
    extends java.lang.Object
    • Field Detail

      • NEED_TO_MANAGE_CONTENT_LENGTH

        public static final java.util.List<java.lang.String> NEED_TO_MANAGE_CONTENT_LENGTH
      • AUTHORIZATION_HEADER

        public static final java.lang.String AUTHORIZATION_HEADER
        See Also:
        Constant Field Values
    • Constructor Detail

      • AuthenticationSupport

        public AuthenticationSupport()
    • Method Detail

      • attemptAuthentication

        public Response attemptAuthentication​(AuthenticatingIntHttpClient authenticatingIntHttpClient,
                                              HttpUrl baseUrl,
                                              java.lang.String authenticationSuffix,
                                              java.util.Map<java.lang.String,​java.lang.String> requestHeaders)
                                       throws com.synopsys.integration.exception.IntegrationException
        Throws:
        com.synopsys.integration.exception.IntegrationException
      • attemptAuthentication

        public Response attemptAuthentication​(AuthenticatingIntHttpClient authenticatingIntHttpClient,
                                              HttpUrl baseUrl,
                                              java.lang.String authenticationSuffix,
                                              org.apache.http.HttpEntity httpEntity)
                                       throws com.synopsys.integration.exception.IntegrationException
        Throws:
        com.synopsys.integration.exception.IntegrationException
      • attemptAuthentication

        public Response attemptAuthentication​(AuthenticatingIntHttpClient authenticatingIntHttpClient,
                                              HttpUrl authenticationUrl,
                                              org.apache.http.client.methods.RequestBuilder requestBuilder)
                                       throws com.synopsys.integration.exception.IntegrationException
        Throws:
        com.synopsys.integration.exception.IntegrationException
      • handleErrorResponse

        public void handleErrorResponse​(AuthenticatingIntHttpClient authenticatingIntHttpClient,
                                        org.apache.http.client.methods.HttpUriRequest request,
                                        Response response,
                                        java.lang.String authorizationHeader)
      • retrieveBearerToken

        public java.util.Optional<java.lang.String> retrieveBearerToken​(com.synopsys.integration.log.IntLogger logger,
                                                                        com.google.gson.Gson gson,
                                                                        AuthenticatingIntHttpClient authenticatingIntHttpClient,
                                                                        java.lang.String bearerTokenKey)
      • handleTokenErrorResponse

        public void handleTokenErrorResponse​(AuthenticatingIntHttpClient authenticatingIntHttpClient,
                                             org.apache.http.client.methods.HttpUriRequest request,
                                             Response response)
      • isTokenAlreadyAuthenticated

        public boolean isTokenAlreadyAuthenticated​(org.apache.http.client.methods.HttpUriRequest request)
      • completeTokenAuthenticationRequest

        public void completeTokenAuthenticationRequest​(org.apache.http.client.methods.HttpUriRequest request,
                                                       Response response,
                                                       com.synopsys.integration.log.IntLogger logger,
                                                       com.google.gson.Gson gson,
                                                       AuthenticatingIntHttpClient authenticatingIntHttpClient,
                                                       java.lang.String bearerTokenResponseKey)
      • addBearerToken

        public void addBearerToken​(com.synopsys.integration.log.IntLogger logger,
                                   org.apache.http.client.methods.HttpUriRequest request,
                                   AuthenticatingIntHttpClient authenticatingIntHttpClient,
                                   java.util.Optional<java.lang.String> bearerToken)
      • addAuthenticationHeader

        public void addAuthenticationHeader​(AuthenticatingIntHttpClient authenticatingIntHttpClient,
                                            org.apache.http.client.methods.HttpUriRequest request,
                                            java.lang.String headerName,
                                            java.lang.String headerValue)