|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectRealmBase
org.jboss.web.tomcat.security.JBossSecurityMgrRealm
An implementation of the catelinz Realm and Valve interfaces. The Realm implementation handles authentication and authorization using the JBossSX security framework. It relieas on the JNDI ENC namespace setup by the AbstractWebContainer. In particular, it uses the java:comp/env/security subcontext to access the security manager interfaces for authorization and authenticaton.
The Valve interface is used to associated the authenticated user with the SecurityAssociation class when a request begins so that web components may call EJBs and have the principal propagated. The security association is removed when the request completes.
AuthenticationManager
(src) ,
CertificatePrincipal
(src) ,
RealmMapping
(src) ,
SimplePrincipal
(src) ,
SecurityAssociation
(src) ,
SubjectSecurityManager
(src) ,
Serialized FormConstructor Summary | |
JBossSecurityMgrRealm()
|
Method Summary | |
java.security.Principal |
authenticate(java.lang.String username,
byte[] credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null . |
java.security.Principal |
authenticate(java.lang.String username,
java.lang.String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null . |
java.security.Principal |
authenticate(java.lang.String username,
java.lang.String digest,
java.lang.String nonce,
java.lang.String nc,
java.lang.String cnonce,
java.lang.String qop,
java.lang.String realm,
java.lang.String md5a2)
Return the Principal associated with the specified username, which matches the digest calculated using the given parameters using the method described in RFC 2069; otherwise return null . |
java.security.Principal |
authenticate(java.security.cert.X509Certificate[] certs)
Return the Principal associated with the specified chain of X509 client certificates. |
protected java.security.Principal |
getCachingPrincpal(RealmMapping (src) realmMapping,
java.security.Principal authPrincipal,
java.security.Principal callerPrincipal,
java.lang.Object credential,
javax.security.auth.Subject subject)
Create the session principal tomcat will cache to avoid callouts to this Realm. |
protected java.lang.String |
getName()
Return a short name for this Realm implementation, for use in log messages. |
protected java.lang.String |
getPassword(java.lang.String username)
Return the password associated with the given principal's user name. |
protected java.security.Principal |
getPrincipal(java.lang.String username)
Return the Principal associated with the given user name. |
protected java.util.Set |
getPrincipalRoles(java.security.Principal principal)
Access the set of role Princpals associated with the given caller princpal. |
boolean |
hasRole(java.security.Principal principal,
java.lang.String role)
Returns true if the specified user Principal has
the specified security role, within the context of this
Realm ; otherwise return false . |
void |
setCertificatePrincipal(java.lang.String className)
Set the class name of the CertificatePrincipal used for mapping X509 cert chains to a Princpal. |
void |
start()
Override to allow a single realm to be shared as a realm and valve |
void |
stop()
Override to allow a single realm to be shared as a realm and valve |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JBossSecurityMgrRealm()
Method Detail |
public void setCertificatePrincipal(java.lang.String className)
className
- the CertificatePrincipal implementation class that must
have a no-arg ctor.CertificatePrincipal
(src) public void start() throws LifecycleException
LifecycleException
public void stop() throws LifecycleException
LifecycleException
public java.security.Principal authenticate(java.security.cert.X509Certificate[] certs)
null
.
certs
- Array of client certificates, with the first one in the array
being the certificate of the client itself.public java.security.Principal authenticate(java.lang.String username, java.lang.String digest, java.lang.String nonce, java.lang.String nc, java.lang.String cnonce, java.lang.String qop, java.lang.String realm, java.lang.String md5a2)
null
.
username
- Username of the Principal to look updigest
- Digest which has been submitted by the clientnonce
- Unique (or supposedly unique) token which has been used for
this requestrealm
- Realm namemd5a2
- Second MD5 digest used to calculate the digest : MD5(Method +
":" + uri)public java.security.Principal authenticate(java.lang.String username, java.lang.String credentials)
null
.
username
- Username of the Principal to look upcredentials
- Password or other credentials to use in authenticating
this usernamepublic boolean hasRole(java.security.Principal principal, java.lang.String role)
true
if the specified user Principal
has
the specified security role, within the context of this
Realm
; otherwise return false
. This will be true
when an associated role Principal
can be found whose
getName
method returns a String
equalling the
specified role.
principal
- Principal
for whom the role is to be
checkedrole
- Security role to be checkedpublic java.security.Principal authenticate(java.lang.String username, byte[] credentials)
null
.
username
- Username of the Principal to look upcredentials
- Password or other credentials to use in authenticating
this usernameprotected java.lang.String getName()
protected java.lang.String getPassword(java.lang.String username)
protected java.security.Principal getPrincipal(java.lang.String username)
protected java.util.Set getPrincipalRoles(java.security.Principal principal)
principal
- - the Principal mapped from the authentication principal
and visible from the HttpServletRequest.getUserPrincipal
protected java.security.Principal getCachingPrincpal(RealmMapping (src) realmMapping, java.security.Principal authPrincipal, java.security.Principal callerPrincipal, java.lang.Object credential, javax.security.auth.Subject subject)
realmMapping
- - the role mapping security managerauthPrincipal
- - the principal used for authentication and stored in
the security manager cachecallerPrincipal
- - the possibly different caller principal
representation of the authenticated principalcredential
- - the credential used for authentication
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |