-
Notifications
You must be signed in to change notification settings - Fork 320
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
OAuth2Provider.get_scope() takes 1 positional argument but 2 were given #639
Comments
Seems like django-allauth update to 0.62.0 changes how
|
My setup with django-allauth==0.61.1 and dj-rest-auth==5.0.2 was working fine for like months. Before a few days ago I started getting errors like the above and "allauth.socialaccount.providers.oauth2.client.OAuth2Error: Invalid id_token". Check this reply by one of the main dev of allauth: #503 (comment) Going back to django-allauth==0.57.1 solved my issues. |
I came across this issue while using Github as a provider and @shennnj's solution worked for me. However, while using in the dj-rest-auth/dj_rest_auth/registration/serializers.py Lines 121 to 134 in 429a270
This is not needed in the instantiation of a new client class So to address this problem, I inherited class CstmSocialLoginSerializer(SocialLoginSerializer):
def validate(self, attrs):
...
client = self.client_class(
request,
app.client_id,
app.secret,
adapter.access_token_method,
adapter.access_token_url,
self.callback_url,
scope_delimiter=adapter.scope_delimiter,
headers=adapter.headers,
basic_auth=adapter.basic_auth,
)
... Then added the serializer to my GithubLoginView class GitHubLogin(SocialLoginView):
adapter_class = GitHubOAuth2Adapter
callback_url = "..."
client_class = OAuth2Client
serializer_class = CstmSocialLoginSerializer This solved my problem and I didn't get the error. |
We are encountering this issue with Apple login despite it previously functioning correctly. |
Downgrading to django-allauth to 0.61.1 Fixes the issue. |
@YDA93 - could you share your dj_rest_auth version that works with django-allauth 0.61.1 for social auth via Apple? |
@trackers153 Sure |
Thanks vm, @YDA93 |
Not fixed in |
any solutions? I'm unable to downgrade now since one of the latest PR. Idk which one but I think someone made django-allauth > 64.0.1 or something like that. |
Hi @toniengelhardt & everyone. Just wanted to share this solution if anyone is still having problems. I'm happy to help so feel free to message me via the info on my page. My goal: Versions:
Step 1: Remove scope from dj-rest-auth social login serializer when utilizing an authorization code.
Step 2: Add the updated serializer to the GoogleLogin view.
Step 3: Make sure the following setting are updated.
|
Thanks @joeychrys 🙏🏽 It seems like these two PRs (already merged) are resolving the problem: #655, #668. @iMerica could we get a release for those? |
Getting this error when sending a post request to SocialLoginView. The body of post request contains "code" only. Having this problem on google/facebook/github login.
Similar problem also asked in https://stackoverflow.com/questions/78477908/dj-rest-auth-with-google-login-typeerror-oauth2provider-get-scope-takes-1-po
Did I do any mistake in setting this up?
The error:
Happens during validation in
SocialLoginSerializer
view.py
url.py
views.py
Post request
Post to
/auth/google/
with body of{ "code": "<code_received_after_user_authorize>" }
The text was updated successfully, but these errors were encountered: