Property | Type | Description | |
---|---|---|---|
$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. |
Method | Description | |
---|---|---|
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. |
Method | Description | |
---|---|---|
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. |
public commit ( ) : true | ||
return | true | always. |
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 |
return | AppserverIo\Psr\Security\Acl\GroupInterface | A named group from the principals set |
public createIdentity ( string $name ) : Principal | ||
$name | string | The name of the principal |
return | Principal | The principal instance |
abstract protected getIdentity ( ) : AppserverIo\Psr\Security\PrincipalInterface | ||
return | AppserverIo\Psr\Security\PrincipalInterface | The user identity |
abstract protected getRoleSets ( ) : array | ||
return | array | Array containing the sets of roles |
public getUnauthenticatedIdentity ( ) : AppserverIo\Psr\Security\PrincipalInterface | ||
return | AppserverIo\Psr\Security\PrincipalInterface | The identity instance |
public getUseFirstPass ( ) : boolean | ||
return | boolean | TRUE if the shared state credential should be used, else FALSE |
public getUsernameAndPassword ( ) : array | ||
return | array | Array with name and password, e. g. array(0 => $name, 1 => $password) |
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 |
return | void |
protected CallbackHandlerInterface,AppserverIo\Psr\Security\Auth\Callback $callbackHandler | ||
return | AppserverIo\Psr\Security\Auth\Callback\CallbackHandlerInterface |
protected bool $loginOk | ||
return | boolean |
protected MapInterface,AppserverIo\Collections $params | ||
return | AppserverIo\Collections\MapInterface |
protected String,AppserverIo\Lang $principalClassName | ||
return | AppserverIo\Lang\String |
protected Subject,AppserverIo\Psr\Security\Auth $subject | ||
return | AppserverIo\Psr\Security\Auth\Subject |
protected PrincipalInterface,AppserverIo\Psr\Security $unauthenticatedIdentity | ||
return | AppserverIo\Psr\Security\PrincipalInterface |
protected bool $useFirstPass | ||
return | boolean |