website/docs: make it clearer to use context[]

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-28 12:50:42 +02:00
parent 8619552920
commit eb02c96281
2 changed files with 8 additions and 8 deletions

View File

@ -56,19 +56,19 @@ Additionally, when the policy is executed from a flow, every variable from the f
This includes the following: This includes the following:
- `prompt_data`: Data which has been saved from a prompt stage or an external source. - `context['prompt_data']`: Data which has been saved from a prompt stage or an external source.
- `application`: The application the user is in the process of authorizing. - `context['application']`: The application the user is in the process of authorizing.
- `pending_user`: The currently pending user, see [User](/docs/expressions/reference/user-object) - `context['pending_user']`: The currently pending user, see [User](/docs/expressions/reference/user-object)
- `auth_method`: Authentication method set (this value is set by password stages) - `context['auth_method']`: Authentication method set (this value is set by password stages)
Depending on method, `auth_method_args` is also set. Depending on method, `context['auth_method_args']` is also set.
Can be any of: Can be any of:
- `password`: Standard password login - `password`: Standard password login
- `app_password`: App passowrd (token) - `app_password`: App passowrd (token)
Sets `auth_method_args` to Sets `context['auth_method_args']` to
```json ```json
{ {
"token": { "token": {
@ -81,7 +81,7 @@ This includes the following:
``` ```
- `ldap`: LDAP bind authentication - `ldap`: LDAP bind authentication
Sets `auth_method_args` to Sets `context['auth_method_args']` to
```json ```json
{ {
"source": {} // Information about the source used "source": {} // Information about the source used

View File

@ -22,7 +22,7 @@
"name": "test-not-app-password", "name": "test-not-app-password",
"execution_logging": false, "execution_logging": false,
"bound_to": 1, "bound_to": 1,
"expression": "return auth_method != \"app_password\"" "expression": "return context[\"auth_method\"] != \"app_password\""
} }
}, },
{ {