Documentation

AuthxInterface

Interface AuthxInterface

Table of Contents

Methods

checkPassword()  : int|string|null
Determine if the password is correct for the user.
getCurrentUserId()  : int|string|null
Determine which (if any) user is currently logged in.
loginSession()  : mixed
Set the active user the in the CMS, binding the user ID durably to the session.
loginStateless()  : mixed
Set the active user the in the CMS -- but do *not* start a session.
logoutSession()  : mixed
Close an open session.

Methods

checkPassword()

Determine if the password is correct for the user.

public checkPassword(string $username, string $password) : int|string|null
Parameters
$username : string

The symbolic username known to the user.

$password : string

The plaintext secret which identifies this user.

Return values
int|string|null

If the password is correct, this returns the internal user ID. If the password is incorrect (or if passwords are not supported), it returns NULL.

getCurrentUserId()

Determine which (if any) user is currently logged in.

public getCurrentUserId() : int|string|null
Return values
int|string|null

The UF's internal user ID for the active user. NULL indicates anonymous (not logged into CMS).

loginSession()

Set the active user the in the CMS, binding the user ID durably to the session.

public loginSession(int|string $userId) : mixed
Parameters
$userId : int|string

The UF's internal user ID.

loginStateless()

Set the active user the in the CMS -- but do *not* start a session.

public loginStateless(int|string $userId) : mixed
Parameters
$userId : int|string

The UF's internal user ID.

logoutSession()

Close an open session.

public logoutSession() : mixed

This SHOULD NOT produce an HTTP response (redirect). However, consumers of the authx logout SHOULD be robust against unconventional responses.


        
On this page

Search results