The JaasSecurityManager is responsible both for authenticating credentials
associated with principals and for role mapping. This implementation relies
on the JAAS LoginContext/LoginModules associated with the security
domain name associated with the class for authentication,
and the context JAAS Subject object for role mapping.
| Method from org.jboss.security.plugins.JaasSecurityManager Detail: |
public boolean doesUserHaveRole(Principal principal,
Set rolePrincipals) {
return delegate.doesUserHaveRole(principal, rolePrincipals);
}
Does the current Subject have a role(a Principal) that equates to one
of the role names. This method obtains the Group named 'Roles' from
the principal set of the currently authenticated Subject as determined
by the SecurityAssociation.getSubject() method and then creates a
SimplePrincipal for each name in roleNames. If the role is a member of the
Roles group, then the user has the role. This requires that the caller
establish the correct SecurityAssociation subject prior to calling this
method. In the past this was done as a side-effect of an isValid() call,
but this is no longer the case. |
public void flushCache() {
delegate.flushCache();
}
Not really used anymore as the security manager service manages the
security domain authentication caches. |
public Subject getActiveSubject() {
return delegate.getActiveSubject();
}
Get the currently authenticated Subject. This is a thread local
property shared across all JaasSecurityManager instances. |
public Principal getPrincipal(Principal principal) {
return delegate.getPrincipal(principal);
}
Map the argument principal from the deployment environment principal
to the developer environment. This is called by the EJB context
getCallerPrincipal() to return the Principal as described by
the EJB developer domain. |
public String getSecurityDomain() {
return delegate.getSecurityDomain();
}
Get the name of the security domain associated with this security mgr. |
public Principal getTargetPrincipal(Principal anotherDomainPrincipal,
Map contextMap) {
return delegate.getTargetPrincipal(anotherDomainPrincipal, contextMap);
}
|
public Set getUserRoles(Principal principal) {
return delegate.getUserRoles(principal);
}
Return the set of domain roles the current active Subject 'Roles' group
found in the subject Principals set. |
public boolean isValid(Principal principal,
Object credential) {
return delegate.isValid(principal, credential, null);
}
Validate that the given credential is correct for principal. This
returns the value from invoking isValid(principal, credential, null). |
public boolean isValid(Principal principal,
Object credential,
Subject activeSubject) {
return delegate.isValid(principal, credential, activeSubject);
}
Validate that the given credential is correct for principal. This first
will check the current CachePolicy object if one exists to see if the
user's cached credentials match the given credential. If there is no
credential cache or the cache information is invalid or does not match,
the user is authenticated against the JAAS login modules configured for
the security domain. |
public void setCachePolicy(CachePolicy domainCache) {
delegate.setCachePolicy(domainCache);
}
The domainCache is typically a shared object that is populated
by the login code(LoginModule, etc.) and read by this class in the
isValid() method. |
public void setDeepCopySubjectOption(Boolean flag) {
delegate.setDeepCopySubjectOption(flag);
}
Flag to specify if deep copy of subject sets needs to be
enabled |