-
Notifications
You must be signed in to change notification settings - Fork 313
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 |
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: