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

상속: extends AbstractLoginModule
파일 보기 프로젝트 열기: appserver-io/appserver 1 사용 예제들

공개 메소드들

메소드 설명
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 Perform the authentication of username and password.

보호된 메소드들

메소드 설명
createPasswordHash ( string $name, string $password ) : AppserverIo\Lang\String If hashing is enabled, this method is called from login() prior to password validation.
getCredentials ( ) : AppserverIo\Lang\String Return's the proof of login identity.
getIdentity ( ) : AppserverIo\Psr\Security\PrincipalInterface Return's the authenticated user identity.
getUsername ( ) : AppserverIo\Lang\String Return's the principal's username.
getUsersPassword ( ) : AppserverIo\Lang\String Returns the password for the user from the sharedMap data.
validatePassword ( string $inputPassword, string $expectedPassword ) : boolean A hook that allows subclasses to change the validation of the input password against the expected password. This version checks that neither inputPassword or expectedPassword are null that that inputPassword.equals(expectedPassword) is true;

메소드 상세

createPasswordHash() 보호된 메소드

Subclasses may override it to provide customized password hashing, for example by adding user-specific information or salting. The default version calculates the hash based on the following options: hashAlgorithm: The digest algorithm to use. hashEncoding: The format used to store the hashes (base64 or hex) hashCharset: The encoding used to convert the password to bytes for hashing. digestCallback: The class name of the digest callback implementation that includes pre/post digest content like salts. It will return null if the hash fails for any reason, which will in turn cause validatePassword() to fail.
protected createPasswordHash ( string $name, string $password ) : AppserverIo\Lang\String
$name string Ignored in default version
$password string The password string to be hashed
리턴 AppserverIo\Lang\String The hashed password

getCredentials() 보호된 메소드

Return's the proof of login identity.
protected getCredentials ( ) : AppserverIo\Lang\String
리턴 AppserverIo\Lang\String The proof of login identity

getIdentity() 보호된 메소드

Return's the authenticated user identity.
protected getIdentity ( ) : AppserverIo\Psr\Security\PrincipalInterface
리턴 AppserverIo\Psr\Security\PrincipalInterface The user identity

getUsername() 보호된 메소드

Return's the principal's username.
protected getUsername ( ) : AppserverIo\Lang\String
리턴 AppserverIo\Lang\String The username

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

Returns the password for the user from the sharedMap data.
abstract protected getUsersPassword ( ) : AppserverIo\Lang\String
리턴 AppserverIo\Lang\String The user's password

initialize() 공개 메소드

The following parameters can by default be passed from the configuration. lookupName: The datasource name used to lookup in the naming directory rolesQuery: The database query used to load the user's roles principalsQuery: The database query used to load the user
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() 공개 메소드

Perform the authentication of username and password.
public login ( ) : boolean
리턴 boolean TRUE when login has been successfull, else FALSE

validatePassword() 보호된 메소드

A hook that allows subclasses to change the validation of the input password against the expected password. This version checks that neither inputPassword or expectedPassword are null that that inputPassword.equals(expectedPassword) is true;
protected validatePassword ( string $inputPassword, string $expectedPassword ) : boolean
$inputPassword string The specified password
$expectedPassword string The expected password
리턴 boolean TRUE if the inputPassword is valid, FALSE otherwise