Class ExtractUsernamePasswordFromBasicAuth

    • Field Detail

      • log

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

      • ExtractUsernamePasswordFromBasicAuth

        public ExtractUsernamePasswordFromBasicAuth()
    • Method Detail

      • extractCredentials

        @Nullable
        protected String extractCredentials​(@Nonnull
                                            javax.servlet.http.HttpServletRequest httpRequest)
        Gets the encoded credentials passed in via the HttpHeaders.AUTHORIZATION header. This method checks to ensure that the authentication scheme is HttpServletRequest.BASIC_AUTH and then strips off and returns the follow on Base64-encoded credentials.
        Parameters:
        httpRequest - current HTTP request
        Returns:
        the Base64 encoded credentials, or null
      • decodeCredentials

        @Nullable
        protected Pair<String,​String> decodeCredentials​(@Nonnull @NotEmpty
                                                              String encodedCredentials)
        Decodes the credential string provided in the HTTP header, splits it in to a username and password, and returns them.
        Parameters:
        encodedCredentials - the Base64 encoded credentials
        Returns:
        a pair containing the username and password, respectively, or null