Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add configurable session attributes #16

Merged

Conversation

MauriceBrg
Copy link
Collaborator

Add user_info_to_session_attr_mapping as a new optional parameter. It can be used to add user information to the current session after authentication. It's also possible to rename the Cognito attributes here, so they appear under a different name in the session, e.g.:

{"sub": "user_id", "email": "email", "username": "username"}

Here, the Cognito Subscriber-ID (sub) will be added to the session as user_id. The attributes email and username are added unchanged.

The original default of only adding the email attribute is retained, but you need to explicitly add it to the mapping if you choose to use it.

Fixes #15

@MauriceBrg MauriceBrg merged commit 9e1af9f into fspijkerman:master Apr 19, 2024
@MauriceBrg MauriceBrg deleted the ft-configurable-session-attributes branch April 19, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to configure which user attributes to add to the session
1 participant