-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Amazon Cognito - Where to define my CustomAmazonCognitoProvider #3603
Comments
This is possible, though the process is not documented as this mechanism is likely subject to change. Should that happen it will be noted in the changeog, so feel free to use it as is. You can do the following: create your own module from allauth.socialaccount.providers.amazon_cognito.provider import AmazonCognitoProvider
Then, in your settings.py:
|
Thanks, it works as expected! |
@pennersr I've switched to Auth0 now. I'm able to login and looks good. But for logged in members, their email attribute is not returned (see below screenshot) If my understanding is correct,
Thanks |
Hi all, thanks for this wonderful package. I have a small question.
I've completed setting up AWS Cognito account sign-in. Now, I need a small thing as well. It is to get custom user attributes from Cognito.
Question in short
Where can i add my
CustomAmazonCognitoProvider
after extending?Brief overview
In
allauth/socialaccount/providers/amazon_cognito/provider.py
, we see the classAmazonCognitoProvider
. Inside this class, there isextract_extra_data
method. This method is responsible for getting attributes and it does the job well.Now, i want a custom attribute say;
foo
from Cognito. I've monkey patched the method - insidereturn
just added"zoneinfo": data.get("custom:foo")
. It does work as well.What i've tried
Now that i know it can get the info, since its always better to extend the class, i did below;
I've added this
CustomAmazonCognitoProvider
in settings as:This caused
raise MultipleObjectsReturned django.core.exceptions.MultipleObjectsReturned
Question
What i posted above, it might be also wrong, not sure where to put my
CustomAmazonCognitoProvider
. Question is, where do i putCustomAmazonCognitoProvider
? DoesCustomAmazonCognitoProvider
seems to be okay?Thanks for reading!
The text was updated successfully, but these errors were encountered: