You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To see if I can log in with a recent access token, I signed in with my Google account from the homepage , copied the access token from the admin section and submitted it to the endpoint http://localhost:8000/dj-rest-auth/google/. I was able to receive the auth token generated by dj_rest_auth.
I need help in getting the auth token by providing code in the post request.
I've tested Google Login with the same environment you pasted.
I found that the error occurs in the situation as follows.
When the code is expired. (expiration is a few minutes)
When callback_url does not match <YOUR CALLBACK URL> and OAuth setting in GoogleCloudConsole.
In addition, callback_url should be set as the front-end's callback URL, not a Django's URL.
So if you host front-end in localhost:3000 and endpoint is /callback, the callback_url should be callback_url = "localhost:3000/callback"
I've tested Google Login with the same environment you pasted.
I found that the error occurs in the situation as follows.
When the code is expired. (expiration is a few minutes)
When callback_url does not match <YOUR CALLBACK URL> and OAuth setting in GoogleCloudConsole.
In addition, callback_url should be set as the front-end's callback URL, not a Django's URL. So if you host front-end in localhost:3000 and endpoint is /callback, the callback_url should be callback_url = "localhost:3000/callback"
Can you check and try this? Thank you.
Thank you @YZ775 for explaining. I've tried and it works. :)
I'm trying to implement Google sign in using DRF and dj_rest_auth.
I've set up 'django-allauth' with Google as provider and the sign in process works in the web browser.
I need to connect an android app with my backend. I've created API endpoints which will require authentication.
According to the docs, code is required in order to complete authentication and receive the token.
After doing some research, I found that code required by dj_rest_auth can be obtained by visiting:
However, even after passing code returned in the query param (after decoding from URL format), the following error is shown:
To see if I can log in with a recent access token, I signed in with my Google account from the homepage , copied the access token from the admin section and submitted it to the endpoint http://localhost:8000/dj-rest-auth/google/. I was able to receive the auth token generated by dj_rest_auth.
I need help in getting the auth token by providing code in the post request.
My code:
References:
Google Social Authentication with dj-rest-auth #220
Minimal example for SPA implementation of social login #147
Please help me.
The text was updated successfully, but these errors were encountered: