blueprints: allow setting of token key in blueprint context (#4995)
closes #4717 Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -18,7 +18,7 @@ When authenticating with a flow, you'll get an authenticated Session cookie, tha
|
||||
|
||||
### API Token
|
||||
|
||||
Superusers can create tokens to authenticate as any user with a static key, which can optionally be expiring and auto-rotate.
|
||||
Users can create tokens to authenticate as any user with a static key, which can optionally be expiring and auto-rotate.
|
||||
|
||||
### JWT Token
|
||||
|
||||
|
27
website/developer-docs/blueprints/v1/models.md
Normal file
27
website/developer-docs/blueprints/v1/models.md
Normal file
@ -0,0 +1,27 @@
|
||||
# Models
|
||||
|
||||
Some models behave differently and allow for access to different API fields when created via blueprint.
|
||||
|
||||
### `authentik_core.token`
|
||||
|
||||
:::info
|
||||
Requires authentik 2023.4
|
||||
:::
|
||||
|
||||
Via the standard API, a token's key cannot be changed, it can only be rotated. This is to ensure a high entropy in it's key, and to prevent insecure data from being used. However, when provisioning tokens via a blueprint, it may be required to set a token to an existing value.
|
||||
|
||||
With blueprints, the field `key` can be set, to set the token's key to any value.
|
||||
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
# [...]
|
||||
- model: authentik_core.token
|
||||
state: present
|
||||
identifiers:
|
||||
identifier: my-token
|
||||
attrs:
|
||||
key: this-should-be-a-long-value
|
||||
user: !KeyOf my-user
|
||||
intent: api
|
||||
```
|
Reference in New Issue
Block a user