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 (hsingh@eng.sun.com), Jyri Virkki
-
-
Field Summary
Fields Modifier and Type Field Description static StringCERT_REALMNAMEstatic ServerLoginCallbackHandlerdummyCallback
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidaddCredentialToSubject(String name, Subject subject, CallbackHandler handler)static voidauditAuthenticate(String username, String realm, boolean success)static SubjectdoClientLogin(int type, CallbackHandler handler)Perform "login" on the client side.static voiddoClientLogout()Perform logout on the client side.static StringgetJaasContext(String realm)static RealmgetRealmInstance(String realmName)static StringgetValidRealm(String realm)static SubjectgetValidSubject(Subject subject)static voidthrowLoginException(Exception exception)static voidthrowLoginException(Exception e, Function<Exception,String> exceptionStringFn)static voidtryJaasLogin(String jaasCtx, Subject subject)static voidvalidateJaasLogin(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 LoginExceptionPerform 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)
-
-