Piwik\

AuthResult

Authentication result.

Methods

The class defines the following methods:

__construct()

Constructor for AuthResult

Signature

  • It accepts the following parameter(s):

    • $code (int) —

    • $login (string) — identity

    • $tokenAuth (string) —

    • $authContext (array|null) — Optional context the Auth implementation wants to pass on. Declaring token_access_level - null included, meaning "no scope" - states the token scope and stops core looking it up on the token row, so leave the key out unless the implementation knows the scope itself.

getIdentity()

Returns the login used to authenticate.

Signature

  • It returns a string value.

getTokenAuth()

Returns the token_auth to authenticate the current user in the API

Signature

  • It returns a string value.

getCode()

Returns the authentication result code.

Signature

  • It returns a int value.

hasSuperUserAccess()

Returns true if the user has Super User access, false otherwise.

Signature

  • It returns a bool value.

wasAuthenticationSuccessful()

Returns true if this result was successfully authentication.

Signature

  • It returns a bool value.

getAuthContext()

Since Matomo Matomo

Returns optional context payload set during authentication.

Signature

  • Returns: Piwik\array<string,mixed>|null