jdk/src/java.base/unix/classes/sun/net/www/protocol/http/ntlm/NTLMAuthentication.java
changeset 37593 824750ada3d6
parent 32842 831e91e26c15
child 37781 71ed5645f17c
equal deleted inserted replaced
37592:c80f098887f4 37593:824750ada3d6
    37 
    37 
    38 import sun.net.www.HeaderParser;
    38 import sun.net.www.HeaderParser;
    39 import sun.net.www.protocol.http.AuthenticationInfo;
    39 import sun.net.www.protocol.http.AuthenticationInfo;
    40 import sun.net.www.protocol.http.AuthScheme;
    40 import sun.net.www.protocol.http.AuthScheme;
    41 import sun.net.www.protocol.http.HttpURLConnection;
    41 import sun.net.www.protocol.http.HttpURLConnection;
       
    42 import sun.security.action.GetPropertyAction;
    42 
    43 
    43 /**
    44 /**
    44  * NTLMAuthentication:
    45  * NTLMAuthentication:
    45  *
    46  *
    46  * @author Michael McMahon
    47  * @author Michael McMahon
    71 
    72 
    72     private static final NTLMAuthenticationCallback NTLMAuthCallback =
    73     private static final NTLMAuthenticationCallback NTLMAuthCallback =
    73         NTLMAuthenticationCallback.getNTLMAuthenticationCallback();
    74         NTLMAuthenticationCallback.getNTLMAuthenticationCallback();
    74 
    75 
    75     private String hostname;
    76     private String hostname;
    76     private static String defaultDomain; /* Domain to use if not specified by user */
    77     /* Domain to use if not specified by user */
    77 
    78     private static String defaultDomain =
    78     static {
    79             GetPropertyAction.getProperty("http.auth.ntlm.domain", "");
    79         defaultDomain = java.security.AccessController.doPrivileged(
       
    80             new sun.security.action.GetPropertyAction("http.auth.ntlm.domain", ""));
       
    81     };
       
    82 
    80 
    83     public static boolean supportsTransparentAuth () {
    81     public static boolean supportsTransparentAuth () {
    84         return false;
    82         return false;
    85     }
    83     }
    86 
    84 
   141             username = s.substring (i+1);
   139             username = s.substring (i+1);
   142         }
   140         }
   143         password = pw.getPassword();
   141         password = pw.getPassword();
   144         init0();
   142         init0();
   145         try {
   143         try {
   146             String version = java.security.AccessController.doPrivileged(
   144             String version = GetPropertyAction.getProperty("ntlm.version");
   147                     new sun.security.action.GetPropertyAction("ntlm.version"));
       
   148             client = new Client(version, hostname, username, ntdomain, password);
   145             client = new Client(version, hostname, username, ntdomain, password);
   149         } catch (NTLMException ne) {
   146         } catch (NTLMException ne) {
   150             try {
   147             try {
   151                 client = new Client(null, hostname, username, ntdomain, password);
   148                 client = new Client(null, hostname, username, ntdomain, password);
   152             } catch (NTLMException ne2) {
   149             } catch (NTLMException ne2) {