Package org.apache.http.impl.auth
Class CredSspScheme
- java.lang.Object
-
- org.apache.http.impl.auth.AuthSchemeBase
-
- org.apache.http.impl.auth.CredSspScheme
-
- All Implemented Interfaces:
AuthScheme
,ContextAwareAuthScheme
public class CredSspScheme extends AuthSchemeBase
Client implementation of the CredSSP protocol specified in [MS-CSSP].
Note: This is implementation is NOT GSS based. It should be. But there is no Java NTLM implementation as GSS module. Maybe the NTLMEngine can be converted to GSS and then this can be also switched to GSS. In fact it only works in CredSSP+NTLM case.
Based on [MS-CSSP]: Credential Security Support Provider (CredSSP) Protocol (Revision 13.0, 7/14/2016). The implementation was inspired by Python CredSSP and NTLM implementation by Jordan Borean.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
SCHEME_NAME
-
Constructor Summary
Constructors Constructor Description CredSspScheme()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Header
authenticate(Credentials credentials, HttpRequest request)
Deprecated.Header
authenticate(Credentials credentials, HttpRequest request, HttpContext context)
Produces an authorization string for the given set ofCredentials
.java.lang.String
getParameter(java.lang.String name)
Returns authentication parameter with the given name, if available.java.lang.String
getRealm()
Returns authentication realm.java.lang.String
getSchemeName()
Returns textual designation of the given authentication scheme.boolean
isComplete()
Authentication process may involve a series of challenge-response exchanges.boolean
isConnectionBased()
Tests if the authentication scheme is provides authorization on a per connection basis instead of usual per request basis-
Methods inherited from class org.apache.http.impl.auth.AuthSchemeBase
getChallengeState, isProxy, processChallenge, toString
-
-
-
-
Field Detail
-
SCHEME_NAME
public static final java.lang.String SCHEME_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSchemeName
public java.lang.String getSchemeName()
Description copied from interface:AuthScheme
Returns textual designation of the given authentication scheme.- Returns:
- the name of the given authentication scheme
-
getParameter
public java.lang.String getParameter(java.lang.String name)
Description copied from interface:AuthScheme
Returns authentication parameter with the given name, if available.- Parameters:
name
- The name of the parameter to be returned- Returns:
- the parameter with the given name
-
getRealm
public java.lang.String getRealm()
Description copied from interface:AuthScheme
Returns authentication realm. If the concept of an authentication realm is not applicable to the given authentication scheme, returnsnull
.- Returns:
- the authentication realm
-
isConnectionBased
public boolean isConnectionBased()
Description copied from interface:AuthScheme
Tests if the authentication scheme is provides authorization on a per connection basis instead of usual per request basis- Returns:
true
if the scheme is connection based,false
if the scheme is request based.
-
authenticate
@Deprecated public Header authenticate(Credentials credentials, HttpRequest request) throws AuthenticationException
Deprecated.Description copied from interface:AuthScheme
Produces an authorization string for the given set ofCredentials
.- Parameters:
credentials
- The set of credentials to be used for athenticationrequest
- The request being authenticated- Returns:
- the authorization string
- Throws:
AuthenticationException
- if authorization string cannot be generated due to an authentication failure
-
authenticate
public Header authenticate(Credentials credentials, HttpRequest request, HttpContext context) throws AuthenticationException
Description copied from interface:ContextAwareAuthScheme
Produces an authorization string for the given set ofCredentials
.- Specified by:
authenticate
in interfaceContextAwareAuthScheme
- Overrides:
authenticate
in classAuthSchemeBase
- Parameters:
credentials
- The set of credentials to be used for athenticationrequest
- The request being authenticatedcontext
- HTTP context- Returns:
- the authorization string
- Throws:
AuthenticationException
- if authorization string cannot be generated due to an authentication failure
-
isComplete
public boolean isComplete()
Description copied from interface:AuthScheme
Authentication process may involve a series of challenge-response exchanges. This method tests if the authorization process has been completed, either successfully or unsuccessfully, that is, all the required authorization challenges have been processed in their entirety.- Returns:
true
if the authentication process has been completed,false
otherwise.
-
-