Class CookieProcessingTargetAuthenticationStrategy

  • All Implemented Interfaces:
    org.apache.http.client.AuthenticationStrategy

    public class CookieProcessingTargetAuthenticationStrategy
    extends org.apache.http.impl.client.TargetAuthenticationStrategy
    TargetAuthenticationStrategy that also processes the cookies in HTTP 401 response. While not fully according to the RFC's, this is often necessary to ensure good load balancing behaviour (e.g., TMG server requires it for authentication, where it sends a HTTP 401 with a new Cookie after 5 minutes of inactivity)
    • Field Summary

      • Fields inherited from class org.apache.http.impl.client.TargetAuthenticationStrategy

        INSTANCE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void authFailed​(org.apache.http.HttpHost arg0, org.apache.http.auth.AuthScheme arg1, org.apache.http.protocol.HttpContext arg2)  
      void authSucceeded​(org.apache.http.HttpHost arg0, org.apache.http.auth.AuthScheme arg1, org.apache.http.protocol.HttpContext arg2)  
      Map<String,​org.apache.http.Header> getChallenges​(org.apache.http.HttpHost authhost, org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context)  
      boolean isAuthenticationRequested​(org.apache.http.HttpHost arg0, org.apache.http.HttpResponse arg1, org.apache.http.protocol.HttpContext arg2)  
      protected boolean isCachable​(org.apache.http.auth.AuthScheme arg0)  
      Queue<org.apache.http.auth.AuthOption> select​(Map<String,​org.apache.http.Header> arg0, org.apache.http.HttpHost arg1, org.apache.http.HttpResponse arg2, org.apache.http.protocol.HttpContext arg3)  
    • Method Detail

      • getChallenges

        public Map<String,​org.apache.http.Header> getChallenges​(org.apache.http.HttpHost authhost,
                                                                      org.apache.http.HttpResponse response,
                                                                      org.apache.http.protocol.HttpContext context)
                                                               throws org.apache.http.auth.MalformedChallengeException
        Specified by:
        getChallenges in interface org.apache.http.client.AuthenticationStrategy
        Throws:
        org.apache.http.auth.MalformedChallengeException
      • isAuthenticationRequested

        public boolean isAuthenticationRequested​(org.apache.http.HttpHost arg0,
                                                 org.apache.http.HttpResponse arg1,
                                                 org.apache.http.protocol.HttpContext arg2)
        Specified by:
        isAuthenticationRequested in interface org.apache.http.client.AuthenticationStrategy
      • select

        public Queue<org.apache.http.auth.AuthOption> select​(Map<String,​org.apache.http.Header> arg0,
                                                             org.apache.http.HttpHost arg1,
                                                             org.apache.http.HttpResponse arg2,
                                                             org.apache.http.protocol.HttpContext arg3)
                                                      throws org.apache.http.auth.MalformedChallengeException
        Specified by:
        select in interface org.apache.http.client.AuthenticationStrategy
        Throws:
        org.apache.http.auth.MalformedChallengeException
      • authSucceeded

        public void authSucceeded​(org.apache.http.HttpHost arg0,
                                  org.apache.http.auth.AuthScheme arg1,
                                  org.apache.http.protocol.HttpContext arg2)
        Specified by:
        authSucceeded in interface org.apache.http.client.AuthenticationStrategy
      • isCachable

        protected boolean isCachable​(org.apache.http.auth.AuthScheme arg0)
      • authFailed

        public void authFailed​(org.apache.http.HttpHost arg0,
                               org.apache.http.auth.AuthScheme arg1,
                               org.apache.http.protocol.HttpContext arg2)
        Specified by:
        authFailed in interface org.apache.http.client.AuthenticationStrategy