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
stringName of config value.
mixedNew config value. Leave unset to get a config value.
\Exception |
If the config can't be loaded or is invalid. |
|---|
mixedConfig value.loadConfig(string $path= null, string $environment= null) : array
stringPath of INI config file to load. Leave null to
read from environment's MONK_ID_CONFIG value.
stringEnvironment 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. |
|---|
arrayLoaded config values.loadPayload(string|array $encodedPayload = null) : array
stringarrayEncoded payload or cookies array to
automatically load the payload from. Leave null to read from global
$_COOKIE.
arrayDecoded and verified payload. Empty if there's no payload
or it fails verification.loggedIn() : boolean
booleanWhether there's a logged in user.signedIn() : boolean
| deprecated | 1.1.0 Use `loggedIn`. |
|---|
booleanWhether there's a logged in user.userEmail() : string | null
stringnullEmail address if logged in user or `null` if no
logged in user.userId() : string | null
stringnullUUID if logged in user or `null` if no logged in
user.COOKIE_NAME = '_monkIdPayload'