Open developer-keev opened 4 years ago
Hi all.
My team and I are constantly using this framework and it seems it has died out there. I contacted the owner by email asking if he would add some of us as maintainers so we could continue to improve it. However we didn't get a response.
I am publishing the project under my profile and we are going to continue to invest time in it.
So I would like to gently ask you to contribute to this project on: https://github.com/wagnerdelima/drf-social-oauth2
Thank you for understanding.
Hi, I'm in the exact same situation, I am trying to get the token with one single API request, it is quite hard to understand the flow ... @wagnerdelima I can copy/paste this issue in your repository if you want ? It might help a LOT of people out there.
I'm following your project ! :)
Please open an issue on the new project. I will take a look at that!
Thanks for following up!
In my Django project with django-rest-framework, we use JWT authentication and want to implement the social login by google. So, I installed and configured django-rest-framework-social-oauth2 with backend google-oath2 in the project as shown in docs. https://github.com/RealmTeam/django-rest-framework-social-oauth2#installation
settings.py
In integration of JWT, AXE and Social-oauth2 is Done.
In Django admin, a new Application created with the following configuration:
https://github.com/RealmTeam/django-rest-framework-social-oauth2#setting-up-a-new-application
Also set urls.py
But now there is confusion about which API to start the authentication process. https://github.com/RealmTeam/django-rest-framework-social-oauth2#testing-the-setup
django-rest-framework-social-oauth2 package relies on python-social-auth and django-oauth-toolkit. so which process to follow? As shown in docs, I understood that first ness to get the token, but this API needs some data as it is POST request. https://127.0.0.1:8000/api/social/token POST JSON DATA
{'client_id': 'known value', 'client_secret': 'known value', 'grant_type': 'password', 'username': 'confused', 'password': 'confused'}
In above json values "confused" means which username to add is it of google-email or username of djnago-user because django-user yet doesn't exist.
And secondly if I follow as per our requirements we need the user to redirect to google-oauth2 page and login with credentials and also our app to access data and create user. This achieved by https://127.0.0.1:8000/api/social/login/google-oauth2/ API it redirect to https://127.0.0.1:8000/api/social/complete/google-oauth2/ with necessary parameters and social user with django user created and redirect to LOGIN_REDIRECT_URL with session authentication.
This part is working and user is created successfully.
But now how to get the access token. In Django admin Social auth user created with provider, uid and extra_data containing access_token, token_type, etc. But how to get access token in the single API request to the front-end so after login to google and authenticate my app to access data then get the access token as it is used to authenticate each request made by the user.
Please need your help to understand the process, I read a lot and watched tutorials but didn't get as expected.
If you need any detail please ask.