class RequestAuthenticationHandler implements AuthenticationHandler (View source)

Core authentication handler / store

Properties

protected AuthenticationHandler[] $handlers

Methods

protected
getHandlers()

This method currently uses a fallback as loading the handlers via YML has proven unstable

public
$this
setHandlers(array $handlers)

Set an associative array of handlers

public
Member|null
authenticateRequest(HTTPRequest $request)

Given the current request, authenticate the request for non-session authorization (outside the CMS).

public
logIn(Member $member, bool $persistent = false, HTTPRequest $request = null)

Log into the identity-store handlers attached to this request filter

public
logOut(HTTPRequest $request = null)

Log out of all the identity-store handlers attached to this request filter

Details

protected AuthenticationHandler[] getHandlers()

This method currently uses a fallback as loading the handlers via YML has proven unstable

Return Value

AuthenticationHandler[]

$this setHandlers(array $handlers)

Set an associative array of handlers

Parameters

array $handlers

Return Value

$this

Member|null authenticateRequest(HTTPRequest $request)

Given the current request, authenticate the request for non-session authorization (outside the CMS).

The Member returned from this method will be provided to the Manager for use in the OperationResolver context in place of the current CMS member.

Authenticators can be given a priority. In this case, the authenticator with the highest priority will be returned first. If not provided, it will default to a low number.

An example for configuring the BasicAuthAuthenticator:

SilverStripe\Security\Security:
  authentication_handlers:
    - SilverStripe\Security\BasicAuthentionHandler

Parameters

HTTPRequest $request

The current HTTP request

Return Value

Member|null

The authenticated Member, or null if this auth mechanism isn't used.

Exceptions

ValidationException

logIn(Member $member, bool $persistent = false, HTTPRequest $request = null)

Log into the identity-store handlers attached to this request filter

Parameters

Member $member

The member to log in.

bool $persistent

boolean If set to true, the login may persist beyond the current session.

HTTPRequest $request

The request of the visitor that is logging in, to get, for example, cookies.

logOut(HTTPRequest $request = null)

Log out of all the identity-store handlers attached to this request filter

Parameters

HTTPRequest $request

The request of the visitor that is logging out, to get, for example, cookies.