org.apache.geronimo.security
Class ContextManager

java.lang.Object
  extended by org.apache.geronimo.security.ContextManager

public class ContextManager
extends Object


Field Summary
static Subject EMPTY
           
static GeronimoSecurityPermission GET_CONTEXT
           
static GeronimoSecurityPermission SET_CONTEXT
           
 
Constructor Summary
ContextManager()
           
 
Method Summary
static void clearCallers()
           
static String getAlgorithm()
           
static Callers getCallers()
           
static Subject getCurrentCaller()
           
static Serializable getCurrentCallerId()
           
static AccessControlContext getCurrentContext()
           
static SubjectId getCurrentId()
           
static Principal getCurrentPrincipal(Subject callerSubject)
           
static Subject getNextCaller()
           
static String getPassword()
           
static Subject getRegisteredSubject(SubjectId id)
           
static Subject getServerSideSubject(Subject clientSideSubject)
          After a login, the client is left with a relatively empty Subject, while the Subject used by the server has more important contents.
static SubjectId getSubjectId(Subject subject)
           
static IdentificationPrincipal getThreadPrincipal()
          Obtain the thread's identifying principal.
static boolean isCallerInRole(String EJBName, String role)
           
static LoginContext login(String realm, CallbackHandler callbackHandler)
           
static void logout(LoginContext loginContext)
           
static void popCallers(Callers oldCallers)
           
static Callers pushNextCaller(Subject nextCaller)
           
static SubjectId registerSubject(Subject subject)
           
static void setAlgorithm(String algorithm)
           
static void setCallers(Subject currentCaller, Subject nextCaller)
           
static void setCurrentCallerId(Serializable id)
           
static Callers setNextCaller(Subject nextCaller)
           
static void setPassword(String password)
           
static void unregisterSubject(Subject subject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GET_CONTEXT

public static final GeronimoSecurityPermission GET_CONTEXT

SET_CONTEXT

public static final GeronimoSecurityPermission SET_CONTEXT

EMPTY

public static final Subject EMPTY
Constructor Detail

ContextManager

public ContextManager()
Method Detail

login

public static LoginContext login(String realm,
                                 CallbackHandler callbackHandler)
                          throws LoginException
Throws:
LoginException

logout

public static void logout(LoginContext loginContext)
                   throws LoginException
Throws:
LoginException

getServerSideSubject

public static Subject getServerSideSubject(Subject clientSideSubject)
After a login, the client is left with a relatively empty Subject, while the Subject used by the server has more important contents. This method lets a server-side component acting as an authentication client (such as Tocmat/Jetty) access the fully populated server-side Subject.

Parameters:
clientSideSubject - client simplification of actual subject
Returns:
full server side subject

setCurrentCallerId

public static void setCurrentCallerId(Serializable id)

getCurrentCallerId

public static Serializable getCurrentCallerId()

setCallers

public static void setCallers(Subject currentCaller,
                              Subject nextCaller)

clearCallers

public static void clearCallers()

getCallers

public static Callers getCallers()

setNextCaller

public static Callers setNextCaller(Subject nextCaller)

pushNextCaller

public static Callers pushNextCaller(Subject nextCaller)

popCallers

public static void popCallers(Callers oldCallers)

getCurrentCaller

public static Subject getCurrentCaller()

getNextCaller

public static Subject getNextCaller()

getCurrentContext

public static AccessControlContext getCurrentContext()

getCurrentPrincipal

public static Principal getCurrentPrincipal(Subject callerSubject)

getCurrentId

public static SubjectId getCurrentId()

getSubjectId

public static SubjectId getSubjectId(Subject subject)

isCallerInRole

public static boolean isCallerInRole(String EJBName,
                                     String role)

getRegisteredSubject

public static Subject getRegisteredSubject(SubjectId id)

registerSubject

public static SubjectId registerSubject(Subject subject)

unregisterSubject

public static void unregisterSubject(Subject subject)

getThreadPrincipal

public static IdentificationPrincipal getThreadPrincipal()
Obtain the thread's identifying principal.

Clients should use Subject.doAs* to associate a Subject with the thread's call stack. It is this Subject that will be used for authentication checks.

Return a IdentificationPrincipal. This kind of principal is inserted into a subject if one uses one of the Geronimo LoginModules. It is a secure id that identifies the Subject.

Returns:
the principal that identifies the Subject of this thread.
See Also:
Subject.doAs(javax.security.auth.Subject, java.security.PrivilegedAction), Subject.doAs(javax.security.auth.Subject, java.security.PrivilegedExceptionAction), Subject.doAsPrivileged(javax.security.auth.Subject, java.security.PrivilegedAction, java.security.AccessControlContext), Subject.doAsPrivileged(javax.security.auth.Subject, java.security.PrivilegedExceptionAction, java.security.AccessControlContext)

getAlgorithm

public static String getAlgorithm()

setAlgorithm

public static void setAlgorithm(String algorithm)

getPassword

public static String getPassword()

setPassword

public static void setPassword(String password)


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.