站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 server API Documentation 英文版文档

NullSecurityManager (JBoss Server API) - JBoss 4.0.1 sp1 server API Documentation 英文版文档


org.jboss.security.plugins
Class NullSecurityManager

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

public class NullSecurityManager
extends Object
implements SubjectSecurityManager, RealmMapping, Serializable

An implementation of SubjectSecurityManager, RealmMapping that authenticates everyone and for which Principals have any role requested. It can be used as a pass-through security manager when you want noop security.

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

Constructor Summary
NullSecurityManager(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

NullSecurityManager

public NullSecurityManager(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 AnybodyPrincipal as the sole role.


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