Skip to content

custom attribute wih underscore in enrollment behaves strange #12693

Discussion options

You must be logged in to vote

Answer of support:

This is due to how we parse attributes in the user write stage: https://github.com/goauthentik/authentik/blob/main/authentik/stages/user_write/stage.py#L42
 
To avoid this, you can set attributes to be a dictionary instead:
 
first_name = request.context['prompt_data']['first_name']
last_name = request.context['prompt_data']['last_name']
request.context['prompt_data']['name'] = first_name + " " + last_name
attrs = request.context['prompt_data'].setdefault('attributes', {})
attrs['first_name'] = first_name
attrs['last_name'] = last_name
 
Kind regards,

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by DunklerPhoenix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant