version: 1
metadata:
name: Default - Source enrollment flow
entries:
- attrs:
designation: enrollment
name: Welcome to authentik! Please select a username.
title: Welcome to authentik! Please select a username.
authentication: none
identifiers:
slug: default-source-enrollment
model: authentik_flows.flow
id: flow
order: 100
placeholder: Username
placeholder_expression: false
required: true
type: text
field_key: username
label: Username
id: prompt-field-username
model: authentik_stages_prompt.prompt
expression: |
# Check if we''ve not been given a username by the external IdP
# and trigger the enrollment flow
return 'username' not in context.get('prompt_data', {})
name: default-source-enrollment-if-username
id: default-source-enrollment-if-username
model: authentik_policies_expression.expressionpolicy
# This policy ensures that this flow can only be used when the user
# is in a SSO Flow (meaning they come from an external IdP)
return ak_is_sso_flow
name: default-source-enrollment-if-sso
id: default-source-enrollment-if-sso
session_duration: seconds=0
name: default-source-enrollment-login
id: default-source-enrollment-login
model: authentik_stages_user_login.userloginstage
fields:
- !KeyOf prompt-field-username
name: default-source-enrollment-prompt
id: default-source-enrollment-prompt
model: authentik_stages_prompt.promptstage
- identifiers:
name: default-source-enrollment-write
id: default-source-enrollment-write
model: authentik_stages_user_write.userwritestage
re_evaluate_policies: true
order: 0
stage: !KeyOf default-source-enrollment-prompt
target: !KeyOf flow
id: prompt-binding
model: authentik_flows.flowstagebinding
order: 1
stage: !KeyOf default-source-enrollment-write
order: 2
stage: !KeyOf default-source-enrollment-login
policy: !KeyOf default-source-enrollment-if-sso
model: authentik_policies.policybinding
policy: !KeyOf default-source-enrollment-if-username
target: !KeyOf prompt-binding