PHP Class AppserverIo\Appserver\ServletEngine\Security\Realm

Inheritance: implements AppserverIo\Appserver\ServletEngine\Security\RealmInterface
Afficher le fichier Open project: appserver-io/appserver Class Usage Examples

Protected Properties

Свойство Type Description
$authenticationManager AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface The authentication manager instance.
$configruation AppserverIo\Appserver\ServletEngine\Security\SecurityDomainInterface The security domain's login modules.
$exceptionStack AppserverIo\Collections\ArrayList A stack with the exception throwed during authentication.
$name string The security domain's name.

Méthodes publiques

Méthode Description
__construct ( AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface $authenticationManager, string $name ) Initialize the security domain with the passed name.
authenticate ( string $username, string $password ) : AppserverIo\Security\PrincipalInterface | null Finally tries to authenticate the user with the passed name.
authenticateByUsernameAndCallbackHandler ( string $username, AppserverIo\Psr\Security\Auth\Callback\CallbackHandlerInterface $callbackHandler ) : AppserverIo\Security\PrincipalInterface | null Finally tries to authenticate the user with the passed name.
getAuthenticationManager ( ) : AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface Return's the authentication manager instance.
getConfiguration ( ) : AppserverIo\Appserver\ServletEngine\Security\SecurityDomainInterface Return's the realm's configuration.
getExceptionStack ( ) : AppserverIo\Collections\ArrayList Return's the exception stack.
getName ( ) : string Return's the name of the security domain.
injectConfiguration ( AppserverIo\Appserver\Core\Api\Node\SecurityDomainNodeInterface $configuration ) : void Inject the realm's configuration.

Méthodes protégées

Méthode Description
createPrincipal ( string $username, AppserverIo\Psr\Security\Auth\Subject $subject, AppserverIo\Psr\Security\Auth\Login\LoginContextInterface $loginContext ) : AppserverIo\Security\PrincipalInterface Identify and return an instance implementing the PrincipalInterface that represens the authenticated user for the specified Subject. The Principal is constructed by scanning the list of Principals returned by the LoginModule. The first Principal object that matches one of the class names supplied as a "user class" is the user Principal. This object is returned to the caller. Any remaining principal objects returned by the LoginModules are mapped to roles, but only if their respective classes match one of the "role class" classes. If a user Principal cannot be constructed, return NULL.

Method Details

__construct() public méthode

Initialize the security domain with the passed name.
public __construct ( AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface $authenticationManager, string $name )
$authenticationManager AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface The authentication manager instance
$name string The security domain's name

authenticate() public méthode

Finally tries to authenticate the user with the passed name.
public authenticate ( string $username, string $password ) : AppserverIo\Security\PrincipalInterface | null
$username string The name of the user to authenticate
$password string The password used for authentication
Résultat AppserverIo\Security\PrincipalInterface | null The authenticated user principal

authenticateByUsernameAndCallbackHandler() public méthode

Finally tries to authenticate the user with the passed name.
public authenticateByUsernameAndCallbackHandler ( string $username, AppserverIo\Psr\Security\Auth\Callback\CallbackHandlerInterface $callbackHandler ) : AppserverIo\Security\PrincipalInterface | null
$username string The name of the user to authenticate
$callbackHandler AppserverIo\Psr\Security\Auth\Callback\CallbackHandlerInterface The callback handler used to load the credentials
Résultat AppserverIo\Security\PrincipalInterface | null The authenticated user principal

createPrincipal() protected méthode

Identify and return an instance implementing the PrincipalInterface that represens the authenticated user for the specified Subject. The Principal is constructed by scanning the list of Principals returned by the LoginModule. The first Principal object that matches one of the class names supplied as a "user class" is the user Principal. This object is returned to the caller. Any remaining principal objects returned by the LoginModules are mapped to roles, but only if their respective classes match one of the "role class" classes. If a user Principal cannot be constructed, return NULL.
protected createPrincipal ( string $username, AppserverIo\Psr\Security\Auth\Subject $subject, AppserverIo\Psr\Security\Auth\Login\LoginContextInterface $loginContext ) : AppserverIo\Security\PrincipalInterface
$username string The associated user name
$subject AppserverIo\Psr\Security\Auth\Subject The Subject representing the logged-in user
$loginContext AppserverIo\Psr\Security\Auth\Login\LoginContextInterface Associated with the Principal so {@link LoginContext#logout()} can be called later
Résultat AppserverIo\Security\PrincipalInterface the principal object

getAuthenticationManager() public méthode

Return's the authentication manager instance.
public getAuthenticationManager ( ) : AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface
Résultat AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface The authentication manager instance

getConfiguration() public méthode

Return's the realm's configuration.
public getConfiguration ( ) : AppserverIo\Appserver\ServletEngine\Security\SecurityDomainInterface
Résultat AppserverIo\Appserver\ServletEngine\Security\SecurityDomainInterface The realm's configuration

getExceptionStack() public méthode

Return's the exception stack.
public getExceptionStack ( ) : AppserverIo\Collections\ArrayList
Résultat AppserverIo\Collections\ArrayList The exception stack

getName() public méthode

Return's the name of the security domain.
public getName ( ) : string
Résultat string The security domain's name

injectConfiguration() public méthode

Inject the realm's configuration.
public injectConfiguration ( AppserverIo\Appserver\Core\Api\Node\SecurityDomainNodeInterface $configuration ) : void
$configuration AppserverIo\Appserver\Core\Api\Node\SecurityDomainNodeInterface The realm's configuration
Résultat void

Property Details

$authenticationManager protected_oe property

The authentication manager instance.
protected AuthenticationManagerInterface,AppserverIo\Appserver\ServletEngine\Security $authenticationManager
Résultat AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface

$configruation protected_oe property

The security domain's login modules.
protected SecurityDomainInterface,AppserverIo\Appserver\ServletEngine\Security $configruation
Résultat AppserverIo\Appserver\ServletEngine\Security\SecurityDomainInterface

$exceptionStack protected_oe property

A stack with the exception throwed during authentication.
protected ArrayList,AppserverIo\Collections $exceptionStack
Résultat AppserverIo\Collections\ArrayList

$name protected_oe property

The security domain's name.
protected string $name
Résultat string