PHP Class Gdn_Authenticator, vanilla

Inheritance: extends Gdn_Pluggable
Show file Open project: vanilla/vanilla Class Usage Examples

Public Properties

Property Type Description
$_DataHooks array

Protected Properties

Property Type Description
$_AuthenticationSchemeAlias Alias of the authentication scheme to use, e.g. "password" or "openid".
$_DataSource null
$_DataSourceType string

Public Methods

Method Description
__construct ( )
authenticate ( ) Returns the unique id assigned to the user in the database.
authorizeToken ( $TokenKey ) : boolean
clearNonces ( $TokenKey )
createToken ( $TokenType, $ProviderKey, null $UserKey = null, boolean $Authorized = false ) : array | boolean
currentStep ( )
dataSourceType ( ) : string
deAuthenticate ( )
deleteToken ( $ProviderKey, $UserKey, $TokenType )
failedResponse ( ) What to do if the entry/auth/* page is triggered but login is denied or fails.
fetchData ( $DataSource, array $DirectSupplied = [] )
getAuthenticationSchemeAlias ( ) : string
getNonce ( ) : array | boolean | stdClass
getProvider ( null $ProviderKey = null, boolean $Force = false ) : array | boolean | stdClass
getProviderKey ( ) : boolean
getProviderSecret ( ) : boolean
getProviderUrl ( ) : boolean
getProviderValue ( $Key, boolean $Default = false ) : boolean
getToken ( ) : array | boolean | stdClass
getURL ( $URLType ) : mixed Get one of the three Forwarding URLs (Registration, SignIn, SignOut).
getValue ( $Key, boolean $Default = false ) : boolean
hookDataField ( $InternalFieldName, $DataFieldName, boolean $DataFieldRequired = true )
loginResponse ( ) What to do if entry/auth/* is called while the user is logged out.
logoutResponse ( ) What to do if the entry/leave/* page is triggered for a user that is logged in and successfully logs out.
lookupNonce ( $TokenKey, null $Nonce = null ) : boolean
lookupToken ( $ProviderKey, $UserKey, null $TokenType = null ) : array | boolean | stdClass
partialResponse ( ) What to do after part 1 of a 2 part authentication process.
repeatResponse ( ) What to do if the entry/auth/* page is triggered for a user that is already logged in.
requireLogoutTransientKey ( ) : boolean
setIdentity ( $UserID, boolean $Persist = true )
setNonce ( $TokenKey, $Nonce, null $Timestamp = null ) : boolean
successResponse ( ) What to do after authentication has succeeded.
wakeUp ( )

Protected Methods

Method Description
_checkHookedFields ( ) : string

Method Details

__construct() public method

public __construct ( )

_checkHookedFields() protected method

protected _checkHookedFields ( ) : string
return string

authenticate() abstract public method

This method should return 0 if the username/password combination were not found, or -1 if the user does not have permission to sign in.
abstract public authenticate ( )

authorizeToken() public method

public authorizeToken ( $TokenKey ) : boolean
$TokenKey
return boolean

clearNonces() public method

public clearNonces ( $TokenKey )
$TokenKey

createToken() public method

public createToken ( $TokenType, $ProviderKey, null $UserKey = null, boolean $Authorized = false ) : array | boolean
$TokenType
$ProviderKey
$UserKey null
$Authorized boolean
return array | boolean

currentStep() abstract public method

abstract public currentStep ( )

dataSourceType() public method

public dataSourceType ( ) : string
return string

deAuthenticate() abstract public method

abstract public deAuthenticate ( )

deleteToken() public method

public deleteToken ( $ProviderKey, $UserKey, $TokenType )
$ProviderKey
$UserKey
$TokenType

failedResponse() public method

What to do if the entry/auth/* page is triggered but login is denied or fails.
public failedResponse ( )

fetchData() public method

public fetchData ( $DataSource, array $DirectSupplied = [] )
$DataSource
$DirectSupplied array

getAuthenticationSchemeAlias() public method

getNonce() public method

public getNonce ( ) : array | boolean | stdClass
return array | boolean | stdClass

getProvider() public method

public getProvider ( null $ProviderKey = null, boolean $Force = false ) : array | boolean | stdClass
$ProviderKey null
$Force boolean
return array | boolean | stdClass

getProviderKey() public method

public getProviderKey ( ) : boolean
return boolean

getProviderSecret() public method

public getProviderSecret ( ) : boolean
return boolean

getProviderUrl() public method

public getProviderUrl ( ) : boolean
return boolean

getProviderValue() public method

public getProviderValue ( $Key, boolean $Default = false ) : boolean
$Key
$Default boolean
return boolean

getToken() public method

public getToken ( ) : array | boolean | stdClass
return array | boolean | stdClass

getURL() abstract public method

Get one of the three Forwarding URLs (Registration, SignIn, SignOut).
abstract public getURL ( $URLType ) : mixed
$URLType
return mixed

getValue() public method

public getValue ( $Key, boolean $Default = false ) : boolean
$Key
$Default boolean
return boolean

hookDataField() public method

public hookDataField ( $InternalFieldName, $DataFieldName, boolean $DataFieldRequired = true )
$InternalFieldName
$DataFieldName
$DataFieldRequired boolean

loginResponse() abstract public method

Should normally be REACT_RENDER.
abstract public loginResponse ( )

logoutResponse() public method

What to do if the entry/leave/* page is triggered for a user that is logged in and successfully logs out.
public logoutResponse ( )

lookupNonce() public method

public lookupNonce ( $TokenKey, null $Nonce = null ) : boolean
$TokenKey
$Nonce null
return boolean

lookupToken() public method

public lookupToken ( $ProviderKey, $UserKey, null $TokenType = null ) : array | boolean | stdClass
$ProviderKey
$UserKey
$TokenType null
return array | boolean | stdClass

partialResponse() abstract public method

This is used in conjunction with OAauth/OpenID type authentication schemes.
abstract public partialResponse ( )

repeatResponse() abstract public method

What to do if the entry/auth/* page is triggered for a user that is already logged in.
abstract public repeatResponse ( )

requireLogoutTransientKey() public method

setIdentity() public method

public setIdentity ( $UserID, boolean $Persist = true )
$UserID
$Persist boolean

setNonce() public method

public setNonce ( $TokenKey, $Nonce, null $Timestamp = null ) : boolean
$TokenKey
$Nonce
$Timestamp null
return boolean

successResponse() abstract public method

What to do after authentication has succeeded.
abstract public successResponse ( )

wakeUp() abstract public method

abstract public wakeUp ( )

Property Details

$_AuthenticationSchemeAlias protected property

Alias of the authentication scheme to use, e.g. "password" or "openid".
protected $_AuthenticationSchemeAlias

$_DataHooks public property

public array $_DataHooks
return array

$_DataSource protected property

protected null $_DataSource
return null

$_DataSourceType protected property

protected string $_DataSourceType
return string