Git Product home page Git Product logo

Comments (6)

PhilipGarnero avatar PhilipGarnero commented on September 21, 2024

It isn't a rest framework token but a oauth2_provider AccessToken.

from django-rest-framework-social-oauth2.

arnaudrenaud avatar arnaudrenaud commented on September 21, 2024

I fail to understand whether there is any built-in way to return a token or a session ID to the client after having logged in.

from django-rest-framework-social-oauth2.

PhilipGarnero avatar PhilipGarnero commented on September 21, 2024

I don't understand what you're trying to do here.
If you're meaning receiving the token for the first time, it is covered in the readme.

curl -X POST -d "client_id=<client_id>&client_secret=<client_secret>&grant_type=password&username=<user_name>&password=" http://localhost:8000/auth/token

If that is unclear for you, I suggest you read a bit more on the oauth2 process.

from django-rest-framework-social-oauth2.

arnaudrenaud avatar arnaudrenaud commented on September 21, 2024

I already have an access token (got it from the conversion of the third-party token).
I'm now trying to link the access token to the matching user in the User table (django.contrib.auth.models).

I'm referring to this excerpt from the readme:
You should use this token on each and further communications between your system/application and your api to authenticate each request and avoid authenticating with FB every time.

from django-rest-framework-social-oauth2.

PhilipGarnero avatar PhilipGarnero commented on September 21, 2024

Simply use the authentication classes provided and the user will be automatically loaded in request.user

from django-rest-framework-social-oauth2.

arnaudrenaud avatar arnaudrenaud commented on September 21, 2024

Thank you, that worked with the authentication class from oauth2_provider.ext.rest_framework import OAuth2Authentication.

from django-rest-framework-social-oauth2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.