I have project with Djang + React and I need using Google OAuth2 to authenticate user login. Looks like social-auth-app-django
is popular package to use for Django, and I had a search on how to use it.
But I could not find any example with React on frontend. I can see a lot of examples with a button implemented by Djang templates like this.
<a class="btn btn-primary" href="{% url 'social:begin' 'google-oauth2' %}">
Login
</a>
But what it should be pointing to with a React Login
button? And should I pass Google OAuth2 Key or Google OAuth2 Secret from React to Django?
NEED HELP, thanks!
<a href="{% url 'social:begin' 'google-plus' %}">Login</a>
for login, it translates to/login/google-plus/
. This not only get's the acess_token but also creates a "social user" in your database. May be that will point you in the right direction. – Carlsen