org.jboss.security.plugins
Class NoAccessSecurityManager

java.lang.Object
  extended byorg.jboss.security.plugins.NoAccessSecurityManager
All Implemented Interfaces:
AuthenticationManager, RealmMapping, Serializable, SubjectSecurityManager

public class NoAccessSecurityManager
extends Object
implements SubjectSecurityManager, RealmMapping, Serializable

An implementation of SubjectSecurityManager, RealmMapping does not allow any authentication and every check for a role fails.

Version:
$Revision: 1.1 $
Author:
Scott.Stark@jboss.org
See Also:
isValid(java.security.Principal, Object), getPrincipal(java.security.Principal), doesUserHaveRole(java.security.Principal, java.util.Set), Serialized Form

Constructor Summary
NoAccessSecurityManager(String securityDomain)
          Creates a default JaasSecurityManager for with the given securityDomain name.
 
Method Summary
 boolean doesUserHaveRole(Principal principal, Set roleNames)
          Does the current Subject have a role(a Principal) that equates to one of the role names.
 Subject getActiveSubject()
          Get the currently authenticated Subject.
 Principal getPrincipal(Principal principal)
          Always returns the argument principal.
 String getSecurityDomain()
          Get the name of the security domain associated with this security mgr.
 Set getUserRoles(Principal principal)
          Return the set of domain roles the principal has been assigned.
 boolean isValid(Principal principal, Object credential)
          Validate that the given credential is correct for principal.
 boolean isValid(Principal principal, Object credential, Subject activeSubject)
          Validate that the given credential is correct for principal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoAccessSecurityManager

public NoAccessSecurityManager(String securityDomain)
Creates a default JaasSecurityManager for with the given securityDomain name.

Method Detail

getSecurityDomain

public String getSecurityDomain()
Get the name of the security domain associated with this security mgr.

Specified by:
getSecurityDomain in interface AuthenticationManager
Returns:
Name of the security manager security domain.

getActiveSubject

public Subject getActiveSubject()
Get the currently authenticated Subject.

Specified by:
getActiveSubject in interface AuthenticationManager
Returns:
Always returns null.
See Also:
AuthenticationManager.isValid(java.security.Principal, Object), AuthenticationManager.isValid(java.security.Principal, Object, javax.security.auth.Subject)

isValid

public boolean isValid(Principal principal,
                       Object credential)
Validate that the given credential is correct for principal.

Specified by:
isValid in interface AuthenticationManager
Parameters:
principal - - the user identity in the operation environment
credential - - the proof of user identity as known in the operation environment
Returns:
always returns true.

isValid

public boolean isValid(Principal principal,
                       Object credential,
                       Subject activeSubject)
Validate that the given credential is correct for principal. This does not populate the activeSubject with any state since no authentication is performed.

Specified by:
isValid in interface AuthenticationManager
Parameters:
principal - - the user identity in the operation environment
credential - - the proof of user identity as known in the operation environment
Returns:
always returns true.

getPrincipal

public Principal getPrincipal(Principal principal)
Always returns the argument principal.

Specified by:
getPrincipal in interface RealmMapping
Parameters:
principal - the caller principal as known in the operation environment.
Returns:
The argument principal

doesUserHaveRole

public boolean doesUserHaveRole(Principal principal,
                                Set roleNames)
Does the current Subject have a role(a Principal) that equates to one of the role names. This method always returns true.

Specified by:
doesUserHaveRole in interface RealmMapping
Parameters:
principal - - ignored.
roleNames - - ignored.
Returns:
Always returns true.

getUserRoles

public Set getUserRoles(Principal principal)
Return the set of domain roles the principal has been assigned.

Specified by:
getUserRoles in interface RealmMapping
Returns:
The Set with the NobodyPrincipal as the sole role.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.