Integrate Monk ID authentication and single sign-on for apps and websites on the server-side.
author | Monk Development, Inc. |
---|---|
SuppressWarnings | (PHPMD.ElseExpression) |
package | Default |
config(string $key, mixed $value = null
) : mixed
string
Name of config value.
mixed
New config value. Leave unset to get a config value.
\Exception |
If the config can't be loaded or is invalid. |
---|
mixed
Config value.loadConfig(string $path= null
, string $environment= null
) : array
string
Path of INI config file to load. Leave null
to
read from environment's MONK_ID_CONFIG
value.
string
Environment section to use. Leave null
to
read from environment's MONK_ID_ENV
value. Defaults to development
.
\Exception |
If the file doesn't exist or can't be read. |
---|
array
Loaded config values.loadPayload(string|array $encodedPayload = null
) : array
string
array
Encoded payload or cookies array to
automatically load the payload from. Leave null
to read from global
$_COOKIE
.
array
Decoded and verified payload. Empty if there's no payload
or it fails verification.loggedIn() : boolean
boolean
Whether there's a logged in user.signedIn() : boolean
deprecated | 1.1.0 Use `loggedIn`. |
---|
boolean
Whether there's a logged in user.userEmail() : string | null
string
null
Email address if logged in user or `null` if no
logged in user.userId() : string | null
string
null
UUID if logged in user or `null` if no logged in
user.COOKIE_NAME = '_monkIdPayload'