Class BasicAuthenticationInterceptor

  • All Implemented Interfaces:
    org.springframework.http.client.ClientHttpRequestInterceptor

    public class BasicAuthenticationInterceptor
    extends Object
    implements org.springframework.http.client.ClientHttpRequestInterceptor
    Created by Viliam Repan (lazyman).
    • Constructor Detail

      • BasicAuthenticationInterceptor

        public BasicAuthenticationInterceptor​(String username,
                                              String password)
    • Method Detail

      • intercept

        public org.springframework.http.client.ClientHttpResponse intercept​(org.springframework.http.HttpRequest httpRequest,
                                                                            byte[] bytes,
                                                                            org.springframework.http.client.ClientHttpRequestExecution clientHttpRequestExecution)
                                                                     throws IOException
        Specified by:
        intercept in interface org.springframework.http.client.ClientHttpRequestInterceptor
        Throws:
        IOException
      • encodeCredentialsForBasicAuth

        public static String encodeCredentialsForBasicAuth​(String username,
                                                           String password)