public final class SpnegoProvider extends Object
This Class is exposed for developers who want to implement a custom HTTP client.
For more example usage, see the documentation at http://spnego.sourceforge.net
| Modifier and Type | Field and Description |
|---|---|
static GSSManager |
GSS_MANAGER
Factory for GSS-API mechanism.
|
static String |
KERBEROS_MECHANISM |
static Oid |
KERBEROS_V5_OID
GSS-API mechanism "1.2.840.113554.1.2.2".
|
static String |
LEGACY_KERBEROS_MECHANISM |
static String |
SPNEGO_MECHANISM |
static Oid |
SPNEGO_OID
GSS-API mechanism "1.3.6.1.5.5.2".
|
static Oid[] |
SUPPORTED_OIDS
Note: The MIT Kerberos V5 mechanism OID is added for compatibility with
Chromium-based browsers on POSIX OSes.
|
| Modifier and Type | Method and Description |
|---|---|
static GSSName |
createGSSNameForSPN(String spn)
Returns the
GSSName constructed out of the passed-in SPN |
static SpnegoAuthScheme |
getAuthScheme(String header)
Returns the
SpnegoAuthScheme or null if header is missing. |
static GSSName |
getServerName(URL url)
Returns the
GSSName constructed out of the passed-in
URL object. |
static CallbackHandler |
getUsernameAndPasswordHandler(String username,
String password)
Used by the BASIC Auth mechanism for establishing a LoginContext
to authenticate a client/caller/request.
|
public static final GSSManager GSS_MANAGER
public static final String SPNEGO_MECHANISM
public static final String KERBEROS_MECHANISM
public static final String LEGACY_KERBEROS_MECHANISM
public static final Oid SPNEGO_OID
public static final Oid KERBEROS_V5_OID
public static final Oid[] SUPPORTED_OIDS
public static SpnegoAuthScheme getAuthScheme(String header)
SpnegoAuthScheme or null if header is missing.
Throws UnsupportedOperationException if header is NOT Negotiate or Basic.
header - ex. Negotiate or Basicpublic static GSSName createGSSNameForSPN(String spn) throws GSSException
GSSName constructed out of the passed-in SPNspn - GSSExceptionpublic static GSSName getServerName(URL url) throws GSSException
GSSName constructed out of the passed-in
URL object.url - HTTP address of serverGSSExceptionpublic static CallbackHandler getUsernameAndPasswordHandler(String username, String password)
username - client usernamepassword - client passwordCopyright © 2022. All rights reserved.