PHP 클래스 AppserverIo\Appserver\ServletEngine\Security\Auth\Spi\AbstractLoginModule

상속: implements AppserverIo\Psr\Security\Auth\Spi\LoginModuleInterface
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$callbackHandler AppserverIo\Psr\Security\Auth\Callback\CallbackHandlerInterface The callback handler to obtain username and password.
$loginOk boolean Flag indicating if the login phase succeeded. Subclasses that override the login method must set this to true on successful completion of login.
$params AppserverIo\Collections\MapInterface The login module parameters.
$principalClassName AppserverIo\Lang\String The class name used to create a principal.
$sharedState AppserverIo\Collections\MapInterface Used the share the login state between multiple modules.
$subject AppserverIo\Psr\Security\Auth\Subject The Subject to update after a successful login.
$unauthenticatedIdentity AppserverIo\Psr\Security\PrincipalInterface The unauthenticated login identity.
$useFirstPass boolean Flag that the shared state credential should be used.

공개 메소드들

메소드 설명
abort ( ) : boolean Method to abort the authentication process (phase 2).
commit ( ) : true Method to commit the authentication process (phase 2). If the login method completed successfully as indicated by loginOk == true, this method adds the getIdentity() value to the subject getPrincipals() Set.
createIdentity ( string $name ) : Principal Utility method to create a Principal for the given username. This creates an instance of the principalClassName type if this option was specified. If principalClassName was not specified, a SimplePrincipal is created.
getUnauthenticatedIdentity ( ) : AppserverIo\Psr\Security\PrincipalInterface Return's the unauthenticated identity.
getUseFirstPass ( ) : boolean Flag that the shared state credential should be used.
getUsernameAndPassword ( ) : array Called by login() to acquire the username and password strings for authentication. This method does no validation of either.
initialize ( AppserverIo\Psr\Security\Auth\Subject $subject, AppserverIo\Psr\Security\Auth\Callback\CallbackHandlerInterface $callbackHandler, AppserverIo\Collections\MapInterface $sharedState, AppserverIo\Collections\MapInterface $params ) : void Initialize the login module. This stores the subject, callbackHandler and sharedState and options for the login session. Subclasses should override if they need to process their own options. A call to parent::initialize() must be made in the case of an override.
login ( ) : boolean Looks for servlet_engine.authentication.login_module.login_name and servlet_engine.authentication.login_module.login_password values in the sharedState map if the useFirstPass option was true and returns TRUE if they exist. If they do not or are NULL this method returns FALSE.
logout ( ) : boolean Remove the user identity and roles added to the Subject during commit.

보호된 메소드들

메소드 설명
createGroup ( string $name, AppserverIo\Collections\CollectionInterface $principals ) : AppserverIo\Psr\Security\Acl\GroupInterface Find or create a Group with the given name. Subclasses should use this method to locate the 'Roles' group or create additional types of groups.
getIdentity ( ) : AppserverIo\Psr\Security\PrincipalInterface Overriden by subclasses to return the Principal that corresponds to the user primary identity.
getRoleSets ( ) : array Overriden by subclasses to return the Groups that correspond to the to the role sets assigned to the user. Subclasses should create at least a Group named "Roles" that contains the roles assigned to the user.

메소드 상세

abort() 공개 메소드

Method to abort the authentication process (phase 2).
public abort ( ) : boolean
리턴 boolean Alaways TRUE

commit() 공개 메소드

It also adds the members of each Group returned by getRoleSets() to the subject getPrincipals() Set.
public commit ( ) : true
리턴 true always.

createGroup() 보호된 메소드

Find or create a Group with the given name. Subclasses should use this method to locate the 'Roles' group or create additional types of groups.
protected createGroup ( string $name, AppserverIo\Collections\CollectionInterface $principals ) : AppserverIo\Psr\Security\Acl\GroupInterface
$name string The name of the group to create
$principals AppserverIo\Collections\CollectionInterface The list of principals
리턴 AppserverIo\Psr\Security\Acl\GroupInterface A named group from the principals set

createIdentity() 공개 메소드

Utility method to create a Principal for the given username. This creates an instance of the principalClassName type if this option was specified. If principalClassName was not specified, a SimplePrincipal is created.
public createIdentity ( string $name ) : Principal
$name string The name of the principal
리턴 Principal The principal instance

getIdentity() 추상적인 보호된 메소드

Overriden by subclasses to return the Principal that corresponds to the user primary identity.
abstract protected getIdentity ( ) : AppserverIo\Psr\Security\PrincipalInterface
리턴 AppserverIo\Psr\Security\PrincipalInterface The user identity

getRoleSets() 추상적인 보호된 메소드

A second common group is "CallerPrincipal" that provides the application identity of the user rather than the security domain identity.
abstract protected getRoleSets ( ) : array
리턴 array Array containing the sets of roles

getUnauthenticatedIdentity() 공개 메소드

Return's the unauthenticated identity.
public getUnauthenticatedIdentity ( ) : AppserverIo\Psr\Security\PrincipalInterface
리턴 AppserverIo\Psr\Security\PrincipalInterface The identity instance

getUseFirstPass() 공개 메소드

Flag that the shared state credential should be used.
public getUseFirstPass ( ) : boolean
리턴 boolean TRUE if the shared state credential should be used, else FALSE

getUsernameAndPassword() 공개 메소드

Called by login() to acquire the username and password strings for authentication. This method does no validation of either.
public getUsernameAndPassword ( ) : array
리턴 array Array with name and password, e. g. array(0 => $name, 1 => $password)

initialize() 공개 메소드

The following parameters can by default be passed from the configuration. passwordStacking: If this is set to "useFirstPass", the login identity will be taken from the appserver.security.auth.login.name value of the sharedState map, and the proof of identity from the appserver.security.auth.login.password value of the sharedState map principalClass: A Principal implementation that support a constructor taking a string argument for the princpal name unauthenticatedIdentity: The name of the principal to asssign and authenticate when a null username and password are seen
public initialize ( AppserverIo\Psr\Security\Auth\Subject $subject, AppserverIo\Psr\Security\Auth\Callback\CallbackHandlerInterface $callbackHandler, AppserverIo\Collections\MapInterface $sharedState, AppserverIo\Collections\MapInterface $params ) : void
$subject AppserverIo\Psr\Security\Auth\Subject The Subject to update after a successful login
$callbackHandler AppserverIo\Psr\Security\Auth\Callback\CallbackHandlerInterface The callback handler that will be used to obtain the user identity and credentials
$sharedState AppserverIo\Collections\MapInterface A map shared between all configured login module instances
$params AppserverIo\Collections\MapInterface The parameters passed to the login module
리턴 void

login() 공개 메소드

Note that subclasses that override the login method must set the loginOk var to TRUE if the login succeeds in order for the commit phase to populate the Subject. This implementation sets loginOk to TRUE if the login() method returns TRUE, otherwise, it sets loginOk to FALSE. Perform the authentication of username and password.
public login ( ) : boolean
리턴 boolean TRUE if the login credentials are available in the sharedMap, else FALSE

logout() 공개 메소드

Remove the user identity and roles added to the Subject during commit.
public logout ( ) : boolean
리턴 boolean Always TRUE

프로퍼티 상세

$callbackHandler 보호되어 있는 프로퍼티

The callback handler to obtain username and password.
protected CallbackHandlerInterface,AppserverIo\Psr\Security\Auth\Callback $callbackHandler
리턴 AppserverIo\Psr\Security\Auth\Callback\CallbackHandlerInterface

$loginOk 보호되어 있는 프로퍼티

Flag indicating if the login phase succeeded. Subclasses that override the login method must set this to true on successful completion of login.
protected bool $loginOk
리턴 boolean

$params 보호되어 있는 프로퍼티

The login module parameters.
protected MapInterface,AppserverIo\Collections $params
리턴 AppserverIo\Collections\MapInterface

$principalClassName 보호되어 있는 프로퍼티

The class name used to create a principal.
protected String,AppserverIo\Lang $principalClassName
리턴 AppserverIo\Lang\String

$sharedState 보호되어 있는 프로퍼티

Used the share the login state between multiple modules.
protected MapInterface,AppserverIo\Collections $sharedState
리턴 AppserverIo\Collections\MapInterface

$subject 보호되어 있는 프로퍼티

The Subject to update after a successful login.
protected Subject,AppserverIo\Psr\Security\Auth $subject
리턴 AppserverIo\Psr\Security\Auth\Subject

$unauthenticatedIdentity 보호되어 있는 프로퍼티

The unauthenticated login identity.
protected PrincipalInterface,AppserverIo\Psr\Security $unauthenticatedIdentity
리턴 AppserverIo\Psr\Security\PrincipalInterface

$useFirstPass 보호되어 있는 프로퍼티

Flag that the shared state credential should be used.
protected bool $useFirstPass
리턴 boolean