PHP Класс AppserverIo\Appserver\ServletEngine\Security\Realm

Автор: Tim Wagner ([email protected])
Наследование: implements AppserverIo\Appserver\ServletEngine\Security\RealmInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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.

Описание методов

__construct() публичный метод

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() публичный метод

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
Результат AppserverIo\Security\PrincipalInterface | null The authenticated user principal

authenticateByUsernameAndCallbackHandler() публичный метод

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
Результат AppserverIo\Security\PrincipalInterface | null The authenticated user principal

createPrincipal() защищенный метод

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
Результат AppserverIo\Security\PrincipalInterface the principal object

getAuthenticationManager() публичный метод

Return's the authentication manager instance.
public getAuthenticationManager ( ) : AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface
Результат AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface The authentication manager instance

getConfiguration() публичный метод

Return's the realm's configuration.
public getConfiguration ( ) : AppserverIo\Appserver\ServletEngine\Security\SecurityDomainInterface
Результат AppserverIo\Appserver\ServletEngine\Security\SecurityDomainInterface The realm's configuration

getExceptionStack() публичный метод

Return's the exception stack.
public getExceptionStack ( ) : AppserverIo\Collections\ArrayList
Результат AppserverIo\Collections\ArrayList The exception stack

getName() публичный метод

Return's the name of the security domain.
public getName ( ) : string
Результат string The security domain's name

injectConfiguration() публичный метод

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
Результат void

Описание свойств

$authenticationManager защищенное свойство

The authentication manager instance.
protected AuthenticationManagerInterface,AppserverIo\Appserver\ServletEngine\Security $authenticationManager
Результат AppserverIo\Appserver\ServletEngine\Security\AuthenticationManagerInterface

$configruation защищенное свойство

The security domain's login modules.
protected SecurityDomainInterface,AppserverIo\Appserver\ServletEngine\Security $configruation
Результат AppserverIo\Appserver\ServletEngine\Security\SecurityDomainInterface

$exceptionStack защищенное свойство

A stack with the exception throwed during authentication.
protected ArrayList,AppserverIo\Collections $exceptionStack
Результат AppserverIo\Collections\ArrayList

$name защищенное свойство

The security domain's name.
protected string $name
Результат string