-
Notifications
You must be signed in to change notification settings - Fork 123
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
is code is access token? #148
Comments
yes when it comes to facebook and google, even i have the same question. facebook and google does not return a 'code' it returns an accessToken and i have the same exact problem as you do. |
Also having this problem |
so. i resolved the problem by using this. https://python-social-auth.readthedocs.io/en/latest/use_cases.html#signup-by-oauth-access-token u don't have to use any of the packages. python social auth already has something for apis. |
@shrinidhinhegde could you please share your repo over here? |
@imanaspaul no it's a private project and the link I have shared is pretty straightforward. I will share a part of my views file tho.
you can set up a URL to this view like this
the methods for each site(i.e. Github, Facebook, etc. is slightly different. but you just need to pass the access token in I am using this view to authenticate using GitHub, Twitter, Facebook and Google and it works peacefully |
Any news on this matter? The example above seems rather rudimentary and, for lack of a better word, "manual". |
Looking at django-rest-framework-social-oauth2 it seems that it has some capability to "convert" a provider access token to a Django access token, using functionality from oauthlib. None of this seems to exist in the ecosystem in which django-rest-social-auth lives. |
I was also trying to implement this custom view using python_social_auth but the issue there is that I can't chose which auth backend I want (session, JWT, know, etc). So if you combine it with django-rest-social-auth and use JWT authentification it won't work because they are both not using the same authentication backend. |
Hey guys,
And say - is facebook auth working or not? |
The accessToken is probably for authentication, and not for authorization. I've been struggling recently with the latest Google Sign In changes because there's not much good support for authorization through JS (it asks the user to authorize the application every time that you need to retrieve the 'code' again). This makes our current auth setup with django-rest-social-auth a bit outdated and worsens UX when loggin in. https://github.com/iMerica/dj-rest-auth gives better support for the new authentication process from google (named Google One Tap), though it needs an update to be aligned with django-allauth (PR is already open for the fix) |
basically, I install the package
and add this in setting
SOCIAL_AUTH_FACEBOOK_KEY = 'i add my FB client id'
SOCIAL_AUTH_FACEBOOK_SECRET = 'i add my FB app secret'
and I add this URL path('api/login/', include('rest_social_auth.urls_token')),]
but when I hit this API (http://localhost:8000/api/login/social/token_user/) with this json ( {
"provider": "facebook",
"code":"my acess token"
}) i am confused what is code is code is access access token? because I am getting this error "Invalid verification code format." when I add my FB acess token
The text was updated successfully, but these errors were encountered: