2022-08-01 21:05:58 +00:00
|
|
|
version: 1
|
2022-08-02 22:05:49 +00:00
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
blueprints.goauthentik.io/system: "true"
|
|
|
|
name: System - OAuth2 Provider - Scopes
|
2022-08-01 21:05:58 +00:00
|
|
|
entries:
|
|
|
|
- identifiers:
|
|
|
|
managed: goauthentik.io/providers/oauth2/scope-openid
|
2022-08-08 18:38:42 +00:00
|
|
|
model: authentik_providers_oauth2.scopemapping
|
2022-08-01 21:05:58 +00:00
|
|
|
attrs:
|
|
|
|
name: "authentik default OAuth Mapping: OpenID 'openid'"
|
|
|
|
scope_name: openid
|
|
|
|
expression: |
|
|
|
|
# This scope is required by the OpenID-spec, and must as such exist in authentik.
|
|
|
|
# The scope by itself does not grant any information
|
|
|
|
return {}
|
|
|
|
- identifiers:
|
|
|
|
managed: goauthentik.io/providers/oauth2/scope-email
|
2022-08-08 18:38:42 +00:00
|
|
|
model: authentik_providers_oauth2.scopemapping
|
2022-08-01 21:05:58 +00:00
|
|
|
attrs:
|
|
|
|
name: "authentik default OAuth Mapping: OpenID 'email'"
|
|
|
|
scope_name: email
|
|
|
|
description: "Email address"
|
|
|
|
expression: |
|
|
|
|
return {
|
|
|
|
"email": request.user.email,
|
|
|
|
"email_verified": True
|
|
|
|
}
|
|
|
|
- identifiers:
|
|
|
|
managed: goauthentik.io/providers/oauth2/scope-profile
|
2022-08-08 18:38:42 +00:00
|
|
|
model: authentik_providers_oauth2.scopemapping
|
2022-08-01 21:05:58 +00:00
|
|
|
attrs:
|
|
|
|
name: "authentik default OAuth Mapping: OpenID 'profile'"
|
|
|
|
scope_name: profile
|
|
|
|
description: "General Profile Information"
|
|
|
|
expression: |
|
|
|
|
return {
|
|
|
|
# Because authentik only saves the user's full name, and has no concept of first and last names,
|
|
|
|
# the full name is used as given name.
|
|
|
|
# You can override this behaviour in custom mappings, i.e. `request.user.name.split(" ")`
|
|
|
|
"name": request.user.name,
|
|
|
|
"given_name": request.user.name,
|
|
|
|
"preferred_username": request.user.username,
|
|
|
|
"nickname": request.user.username,
|
|
|
|
# groups is not part of the official userinfo schema, but is a quasi-standard
|
|
|
|
"groups": [group.name for group in request.user.ak_groups.all()],
|
|
|
|
}
|