< prev index next >

src/java.base/share/classes/sun/net/www/protocol/http/NegotiateAuthentication.java

Print this page




  28 import java.net.URL;
  29 import java.io.IOException;
  30 import java.net.Authenticator.RequestorType;
  31 import java.util.Base64;
  32 import java.util.HashMap;
  33 import sun.net.www.HeaderParser;
  34 import sun.util.logging.PlatformLogger;
  35 import static sun.net.www.protocol.http.AuthScheme.NEGOTIATE;
  36 import static sun.net.www.protocol.http.AuthScheme.KERBEROS;
  37 import sun.security.action.GetPropertyAction;
  38 
  39 /**
  40  * NegotiateAuthentication:
  41  *
  42  * @author weijun.wang@sun.com
  43  * @since 1.6
  44  */
  45 
  46 class NegotiateAuthentication extends AuthenticationInfo {
  47 

  48     private static final long serialVersionUID = 100L;
  49     private static final PlatformLogger logger = HttpURLConnection.getHttpLogger();
  50 
  51     private final HttpCallerInfo hci;
  52 
  53     // These maps are used to manage the GSS availability for diffrent
  54     // hosts. The key for both maps is the host name.
  55     // <code>supported</code> is set when isSupported is checked,
  56     // if it's true, a cached Negotiator is put into <code>cache</code>.
  57     // the cache can be used only once, so after the first use, it's cleaned.
  58     static HashMap <String, Boolean> supported = null;
  59     static ThreadLocal <HashMap <String, Negotiator>> cache = null;
  60     /* Whether cache is enabled for Negotiate/Kerberos */
  61     private static final boolean cacheSPNEGO;
  62     static {
  63         String spnegoCacheProp =
  64             GetPropertyAction.privilegedGetProperty("jdk.spnego.cache", "true");
  65         cacheSPNEGO = Boolean.parseBoolean(spnegoCacheProp);
  66     }
  67 




  28 import java.net.URL;
  29 import java.io.IOException;
  30 import java.net.Authenticator.RequestorType;
  31 import java.util.Base64;
  32 import java.util.HashMap;
  33 import sun.net.www.HeaderParser;
  34 import sun.util.logging.PlatformLogger;
  35 import static sun.net.www.protocol.http.AuthScheme.NEGOTIATE;
  36 import static sun.net.www.protocol.http.AuthScheme.KERBEROS;
  37 import sun.security.action.GetPropertyAction;
  38 
  39 /**
  40  * NegotiateAuthentication:
  41  *
  42  * @author weijun.wang@sun.com
  43  * @since 1.6
  44  */
  45 
  46 class NegotiateAuthentication extends AuthenticationInfo {
  47 
  48     @java.io.Serial
  49     private static final long serialVersionUID = 100L;
  50     private static final PlatformLogger logger = HttpURLConnection.getHttpLogger();
  51 
  52     private final HttpCallerInfo hci;
  53 
  54     // These maps are used to manage the GSS availability for diffrent
  55     // hosts. The key for both maps is the host name.
  56     // <code>supported</code> is set when isSupported is checked,
  57     // if it's true, a cached Negotiator is put into <code>cache</code>.
  58     // the cache can be used only once, so after the first use, it's cleaned.
  59     static HashMap <String, Boolean> supported = null;
  60     static ThreadLocal <HashMap <String, Negotiator>> cache = null;
  61     /* Whether cache is enabled for Negotiate/Kerberos */
  62     private static final boolean cacheSPNEGO;
  63     static {
  64         String spnegoCacheProp =
  65             GetPropertyAction.privilegedGetProperty("jdk.spnego.cache", "true");
  66         cacheSPNEGO = Boolean.parseBoolean(spnegoCacheProp);
  67     }
  68 


< prev index next >