Class LoginContextDriver
- java.lang.Object
-
- com.sun.enterprise.security.auth.login.LoginContextDriver
-
public class LoginContextDriver extends Object
This class is invoked implicitly by the server to log in the user information that was sent on the wire by the client. Clients will use the doClientLogin method to simulate authentication to the server.- Author:
- Harpreet Singh ([email protected]), Jyri Virkki
-
-
Field Summary
Fields Modifier and Type Field Description static String
CERT_REALMNAME
static ServerLoginCallbackHandler
dummyCallback
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addCredentialToSubject(String name, Subject subject, CallbackHandler handler)
static void
auditAuthenticate(String username, String realm, boolean success)
static Subject
doClientLogin(int type, CallbackHandler handler)
Perform "login" on the client side.static void
doClientLogout()
Perform logout on the client side.static String
getJaasContext(String realm)
static Realm
getRealmInstance(String realmName)
static String
getValidRealm(String realm)
static Subject
getValidSubject(Subject subject)
static void
throwLoginException(Exception exception)
static void
throwLoginException(Exception e, Function<Exception,String> exceptionStringFn)
static void
tryJaasLogin(String jaasCtx, Subject subject)
static void
validateJaasLogin(String username, String jaasCtx, String realm, Subject subject)
-
-
-
Field Detail
-
dummyCallback
public static final ServerLoginCallbackHandler dummyCallback
-
CERT_REALMNAME
public static final String CERT_REALMNAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
doClientLogin
public static Subject doClientLogin(int type, CallbackHandler handler) throws LoginException
Perform "login" on the client side. The login consists of putting the credentials in a place where the IIOP/Remote EJB code can find it, and sent it over to the remote server where the actual authentication takes place.- Parameters:
int
- type whether it is username_password or certificate based login.CallbackHandler
- the callback handler to gather user information.- Throws:
LoginException
- the exception thrown by the callback handler.
-
doClientLogout
public static void doClientLogout() throws LoginException
Perform logout on the client side.- Throws:
LoginException
-
validateJaasLogin
public static void validateJaasLogin(String username, String jaasCtx, String realm, Subject subject)
-
tryJaasLogin
public static void tryJaasLogin(String jaasCtx, Subject subject) throws LoginException
- Throws:
LoginException
-
addCredentialToSubject
public static void addCredentialToSubject(String name, Subject subject, CallbackHandler handler)
-
getRealmInstance
public static Realm getRealmInstance(String realmName) throws NoSuchRealmException
- Throws:
NoSuchRealmException
-
throwLoginException
public static void throwLoginException(Exception exception)
-
throwLoginException
public static void throwLoginException(Exception e, Function<Exception,String> exceptionStringFn)
-
-