public class LoginContextDriver extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CERT_REALMNAME |
| Modifier and Type | Method and Description |
|---|---|
static Subject |
doClientLogin(int type,
CallbackHandler jaasHandler)
Perform login on the client side.
|
static void |
doClientLogout()
Perform logout on the client side.
|
static void |
doX500Login(Subject s,
String appModuleID)
A special case login for X500Name credentials.
|
static Subject |
jmacLogin(Subject subject,
String username,
char[] password,
String realmName)
Performs login for JMAC security.
|
static Subject |
jmacLogin(Subject subject,
String identityAssertion,
String realm) |
static Subject |
jmacLogin(Subject subject,
X500Principal x500Principal) |
static void |
login(AssertedCredentials asrtCred) |
static void |
login(DigestCredentials digestCred)
Performs Digest authentication based on RFC 2617.
|
static void |
login(String username,
char[] password,
String realmName)
This method is just a convenience wrapper for
login(Subject, Class) method.
|
static void |
login(Subject subject,
Class cls)
This method performs the login on the server side.
|
static void |
loginPrincipal(String username,
String realmName)
This method is used for logging in a run As principal.
|
static void |
logout()
This method logs out the user by clearing the security context.
|
public static final String CERT_REALMNAME
public static void login(String username, char[] password, String realmName)
String - usernameString - passwordString - realmName the name of the realm to login into, if realmName
is null, we login into the default realmpublic static void login(AssertedCredentials asrtCred) throws LoginException
LoginExceptionpublic static void login(Subject subject, Class cls) throws LoginException
This method is the main login method for S1AS. It is called with a Subject and the type (class) of credential which should be checked. The Subject must contain a credential of the specified type or login will fail.
While the implementation has been cleaned up, the login process still consists of a number of special cases which are treated separately at the realm level. In the future tighter JAAS integration could clean some of this up.
The following credential types are recognized at this time:
Subject - the subject of the clientClass - the class of the credential packaged in the subject.LoginExceptionpublic static void loginPrincipal(String username, String realmName) throws LoginException
LoginExceptionpublic static void logout()
throws LoginException
LoginExceptionpublic static Subject jmacLogin(Subject subject, String username, char[] password, String realmName) throws LoginException
subject - username - password - realmName - the realm to authenticate underLoginExceptionpublic static Subject jmacLogin(Subject subject, X500Principal x500Principal) throws LoginException
LoginExceptionpublic static Subject jmacLogin(Subject subject, String identityAssertion, String realm) throws LoginException
LoginExceptionpublic static void doX500Login(Subject s, String appModuleID) throws LoginException
LoginExceptionpublic static Subject doClientLogin(int type, CallbackHandler jaasHandler) throws LoginException
int - type whether it is username_password or
certificate based login.CallbackHandler - the callback handler to gather user information.LoginException - the exception thrown by the callback handler.public static void doClientLogout()
throws LoginException
LoginExceptionpublic static void login(DigestCredentials digestCred) throws LoginException
digestCred - DigestCredentialsLoginExceptionCopyright © 2017. All rights reserved.