Giter VIP home page Giter VIP logo

Comments (5)

mongkok avatar mongkok commented on July 17, 2024

Hi @paymog ,
There are many ways to login on the client side:

  1. Login with URL redirect HTTP 302
    You can configure the Python Social Auth urls.
    https://python-social-auth-docs.readthedocs.io/en/latest/configuration/django.html#urls-entries

  2. Login without leaving the page

    2.1. Popup (iframe)
    With some JS, you can open a popup window where the user can do the authentication and the popup can be closed when the user is redirected back to the final URL.

    2.2. Client-side JS SDK and GraphQL validation
    Some of the services support JS based login. In this case, you can obtain the access_token and send it through the Mutation SocialAuth to validate the token and save the instance into database, however with Github this is not possible.

(2.2...) I found this, the flow consists of obtaining a provisional code on the client-side and validate it on the backend to obtain the access_token.
I could include a Mutation that receives this code as input and then call the backend.auth_complete() function (Python-Social-Auth) to return the access_token.

from django-graphql-social-auth.

paymog avatar paymog commented on July 17, 2024

Thanks for the response @mongkok! I ended up using Firebase for client side authentication and sending the access token that Firebase retrieves to the backend and it works flawlessly. Thank you again for making this package, it's super useful.

from django-graphql-social-auth.

mongkok avatar mongkok commented on July 17, 2024

ok @paymog !,

anyway, I have created a proof of concept for OAuth2 authentication using the provisional code, it woks!, I will create a PR soon.

This is a the url to get the code for Github
https://github.com/login/oauth/authorize?client_id=CLIENT-ID&response_type=code&redirect_uri=REDIRECT-URI

and this library could provide two alternatives to authenticate users, via access_token or sending the provisional code.

from django-graphql-social-auth.

johnpaul89 avatar johnpaul89 commented on July 17, 2024

I'm trying to integrate the socialAuth mutation with my react frontend, but it is not working.
Is there anything @mongkok @paymog or any link that you can share which might help me with integrating with my react frontend.
Thanks.

from django-graphql-social-auth.

Behoston avatar Behoston commented on July 17, 2024

@mongkok I'm still waiting for PR with code support

from django-graphql-social-auth.

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.