Uses of Interface
org.apache.shiro.subject.Subject
-
Packages that use Subject Package Description org.apache.shiro This package primarily exists as a root classpath distinction, but it does contain two core classes widely used by applications,SecurityUtils
andShiroException
.org.apache.shiro.aop Components used to support the framework's AOP/interception support classes.org.apache.shiro.concurrent Executor
,ExecutorService
, andScheduledExecutorService
implementations for transparentSubject
association with threads in an asynchronous execution environment.org.apache.shiro.mgt Provides the masterSecurityManager
interface and a default implementation hierarchy for managing all aspects of Shiro's functionality in an application.org.apache.shiro.subject Components supporting theSubject
interface, the most important concept in Shiro's API.org.apache.shiro.subject.support Concrete support implementations of most of theorg.apache.shiro.subject
interfaces.org.apache.shiro.util Your run-of-the-mill 'util' package for components and logic widely used across the framework that can't find their home into a proper OO hierarchy (or, most likely for things used across many hierarchies). -
-
Uses of Subject in org.apache.shiro
Methods in org.apache.shiro that return Subject Modifier and Type Method Description static Subject
SecurityUtils. getSubject()
Returns the currently accessibleSubject
available to the calling code depending on runtime environment. -
Uses of Subject in org.apache.shiro.aop
Methods in org.apache.shiro.aop that return Subject Modifier and Type Method Description protected Subject
AnnotationHandler. getSubject()
Returns theSubject
associated with the currently-executing code.protected Subject
MethodInterceptorSupport. getSubject()
Returns theSubject
associated with the currently-executing code. -
Uses of Subject in org.apache.shiro.concurrent
Methods in org.apache.shiro.concurrent that return Subject Modifier and Type Method Description protected Subject
SubjectAwareExecutor. getSubject()
Returns the currently Subject instance that should be associated with Runnable or Callable instances before being dispatched to the targetExecutor
instance. -
Uses of Subject in org.apache.shiro.mgt
Methods in org.apache.shiro.mgt that return Subject Modifier and Type Method Description protected Subject
DefaultSecurityManager. createSubject(AuthenticationToken token, AuthenticationInfo info, Subject existing)
Creates aSubject
instance for the user represented by the given method arguments.Subject
DefaultSecurityManager. createSubject(SubjectContext subjectContext)
This implementation functions as follows:Subject
DefaultSubjectFactory. createSubject(SubjectContext context)
Subject
SecurityManager. createSubject(SubjectContext context)
Creates aSubject
instance reflecting the specified contextual data.Subject
SubjectFactory. createSubject(SubjectContext context)
Creates a new Subject instance reflecting the state of the specified contextual data.protected Subject
DefaultSecurityManager. doCreateSubject(SubjectContext context)
Actually creates aSubject
instance by delegating to the internalsubjectFactory
.Subject
DefaultSecurityManager. login(Subject subject, AuthenticationToken token)
First authenticates theAuthenticationToken
argument, and if successful, constructs aSubject
instance representing the authenticated account's identity.Subject
SecurityManager. login(Subject subject, AuthenticationToken authenticationToken)
Logs in the specified Subject using the givenauthenticationToken
, returning an updated Subject instance reflecting the authenticated state if successful or throwingAuthenticationException
if it is not.protected Subject
DefaultSubjectFactory. newSubjectInstance(PrincipalCollection principals, boolean authenticated, String host, Session session, SecurityManager securityManager)
Deprecated.since 1.2 - overrideDefaultSubjectFactory.createSubject(org.apache.shiro.subject.SubjectContext)
directly if you need to instantiate a customSubject
class.Subject
DefaultSubjectDAO. save(Subject subject)
Saves the subject's state to the subject'ssession
only ifsessionStorageEnabled(subject)
.Subject
SubjectDAO. save(Subject subject)
Persists the specified Subject's state for later access.Methods in org.apache.shiro.mgt with parameters of type Subject Modifier and Type Method Description protected void
DefaultSecurityManager. beforeLogout(Subject subject)
protected void
DefaultSecurityManager. bind(Subject subject)
Deprecated.in favor ofsave(subject)
.protected Subject
DefaultSecurityManager. createSubject(AuthenticationToken token, AuthenticationInfo info, Subject existing)
Creates aSubject
instance for the user represented by the given method arguments.protected void
DefaultSecurityManager. delete(Subject subject)
Removes (or 'unbinds') the Subject's state from the application, typically called duringDefaultSecurityManager.logout(org.apache.shiro.subject.Subject)
..void
DefaultSubjectDAO. delete(Subject subject)
Removes any existing subject state from the subject's session (if the session exists).void
SubjectDAO. delete(Subject subject)
Removes any persisted state for the specifiedSubject
instance.protected abstract void
AbstractRememberMeManager. forgetIdentity(Subject subject)
Forgets (removes) any remembered identity data for the specifiedSubject
instance.protected PrincipalCollection
AbstractRememberMeManager. getIdentityToRemember(Subject subject, AuthenticationInfo info)
boolean
DefaultSessionStorageEvaluator. isSessionStorageEnabled(Subject subject)
This implementation functions as follows: If the specified Subject already has an existingSession
(typically because an application developer has calledsubject.getSession()
already), Shiro will use that existing session to store subject state. If a Subject does not yet have a Session, this implementation checks thesessionStorageEnabled
property: IfsessionStorageEnabled
is true (the default setting), a new session may be created to persist Subject state if necessary. IfsessionStorageEnabled
isfalse
, a new session will not be created to persist session state. Most applications use Sessions and are OK with the defaulttrue
setting forsessionStorageEnabled
.protected boolean
DefaultSubjectDAO. isSessionStorageEnabled(Subject subject)
Determines if the subject's session will be used to persist subject state or not.boolean
SessionStorageEvaluator. isSessionStorageEnabled(Subject subject)
Returnstrue
if the specifiedSubject
'ssession
may be used to persist that Subject's state,false
otherwise.Subject
DefaultSecurityManager. login(Subject subject, AuthenticationToken token)
First authenticates theAuthenticationToken
argument, and if successful, constructs aSubject
instance representing the authenticated account's identity.Subject
SecurityManager. login(Subject subject, AuthenticationToken authenticationToken)
Logs in the specified Subject using the givenauthenticationToken
, returning an updated Subject instance reflecting the authenticated state if successful or throwingAuthenticationException
if it is not.void
DefaultSecurityManager. logout(Subject subject)
void
SecurityManager. logout(Subject subject)
Logs out the specified Subject from the system.protected void
DefaultSubjectDAO. mergeAuthenticationState(Subject subject)
Merges the Subject's current authentication state with whatever may be in any available session.protected void
DefaultSubjectDAO. mergePrincipals(Subject subject)
Merges the Subject's currentgetPrincipals()
with whatever may be in any available session.void
AbstractRememberMeManager. onFailedLogin(Subject subject, AuthenticationToken token, AuthenticationException ae)
Reacts to a failed login by immediatelyforgetting
any previously remembered identity.protected void
DefaultSecurityManager. onFailedLogin(AuthenticationToken token, AuthenticationException ae, Subject subject)
void
RememberMeManager. onFailedLogin(Subject subject, AuthenticationToken token, AuthenticationException ae)
Reacts to a failed authentication attempt, typically by forgetting any previously remembered principals for the Subject.void
AbstractRememberMeManager. onLogout(Subject subject)
Reacts to a subject logging out of the application and immediatelyforgets
any previously stored identity and returns.void
RememberMeManager. onLogout(Subject subject)
Reacts to a Subject logging out of the application, typically by forgetting any previously remembered principals for the Subject.void
AbstractRememberMeManager. onSuccessfulLogin(Subject subject, AuthenticationToken token, AuthenticationInfo info)
Reacts to the successful login attempt by first alwaysforgetting
any previously stored identity.protected void
DefaultSecurityManager. onSuccessfulLogin(AuthenticationToken token, AuthenticationInfo info, Subject subject)
void
RememberMeManager. onSuccessfulLogin(Subject subject, AuthenticationToken token, AuthenticationInfo info)
Reacts to a successful authentication attempt, typically saving the principals to be retrieved ('remembered') for future system access.void
AbstractRememberMeManager. rememberIdentity(Subject subject, AuthenticationToken token, AuthenticationInfo authcInfo)
Remembers a subject-unique identity for retrieval later.protected void
AbstractRememberMeManager. rememberIdentity(Subject subject, PrincipalCollection accountPrincipals)
Remembers the specified account principals by firstconverting
them to a byte array and thenremembers
that byte array.protected void
DefaultSecurityManager. rememberMeFailedLogin(AuthenticationToken token, AuthenticationException ex, Subject subject)
protected void
DefaultSecurityManager. rememberMeLogout(Subject subject)
protected void
DefaultSecurityManager. rememberMeSuccessfulLogin(AuthenticationToken token, AuthenticationInfo info, Subject subject)
protected abstract void
AbstractRememberMeManager. rememberSerializedIdentity(Subject subject, byte[] serialized)
Persists the identity bytes to a persistent store for retrieval later via theAbstractRememberMeManager.getRememberedSerializedIdentity(SubjectContext)
method.protected void
DefaultSubjectDAO. removeFromSession(Subject subject)
Removes any existing subject state from the Subject's session (if the session exists).protected void
DefaultSecurityManager. save(Subject subject)
Saves the subject's state to a persistent location for future reference if necessary.Subject
DefaultSubjectDAO. save(Subject subject)
Saves the subject's state to the subject'ssession
only ifsessionStorageEnabled(subject)
.Subject
SubjectDAO. save(Subject subject)
Persists the specified Subject's state for later access.protected void
DefaultSubjectDAO. saveToSession(Subject subject)
Saves the subject's state (it's principals and authentication state) to itssession
.protected void
DefaultSecurityManager. stopSession(Subject subject)
protected void
DefaultSecurityManager. unbind(Subject subject)
Deprecated.in Shiro 1.2 in favor ofDefaultSecurityManager.delete(org.apache.shiro.subject.Subject)
-
Uses of Subject in org.apache.shiro.subject
Methods in org.apache.shiro.subject that return Subject Modifier and Type Method Description Subject
Subject.Builder. buildSubject()
Creates and returns a newSubject
instance reflecting the cumulative state acquired by the other methods in this class.Subject
SubjectContext. getSubject()
Returns any existingSubject
that may be in use at the time the newSubject
instance is being created.Methods in org.apache.shiro.subject with parameters of type Subject Modifier and Type Method Description void
SubjectContext. setSubject(Subject subject)
Sets the existingSubject
that may be in use at the time the newSubject
instance is being created. -
Uses of Subject in org.apache.shiro.subject.support
Classes in org.apache.shiro.subject.support that implement Subject Modifier and Type Class Description class
DelegatingSubject
Implementation of theSubject
interface that delegates method calls to an underlyingSecurityManager
instance for security checks.Methods in org.apache.shiro.subject.support that return Subject Modifier and Type Method Description Subject
DefaultSubjectContext. getSubject()
protected Subject
SubjectThreadState. getSubject()
Returns theSubject
instance managed by thisThreadState
implementation.Methods in org.apache.shiro.subject.support with parameters of type Subject Modifier and Type Method Description void
DefaultSubjectContext. setSubject(Subject subject)
Constructors in org.apache.shiro.subject.support with parameters of type Subject Constructor Description SubjectCallable(Subject subject, Callable<V> delegate)
SubjectRunnable(Subject subject, Runnable delegate)
Creates a newSubjectRunnable
that, when executed, will execute the targetdelegate
, but guarantees that it will run associated with the specifiedSubject
.SubjectThreadState(Subject subject)
Creates a newSubjectThreadState
that will bind and unbind the specifiedSubject
to the thread -
Uses of Subject in org.apache.shiro.util
Methods in org.apache.shiro.util that return Subject Modifier and Type Method Description static Subject
ThreadContext. getSubject()
Convenience method that simplifies retrieval of a thread-bound Subject.static Subject
ThreadContext. unbindSubject()
Convenience method that simplifies removal of a thread-local Subject from the thread.Methods in org.apache.shiro.util with parameters of type Subject Modifier and Type Method Description static void
ThreadContext. bind(Subject subject)
Convenience method that simplifies binding a Subject to the ThreadContext.
-