I'm trying to setup sso on backend django server and login on frontend react website. Here's what I've done so far
On Django Server
- Created an Google SSO flow which will authenticate user and will create a new user in database with free details from Google.
- Created an API which will give the JWT token containing access_token and refresh_token.
- Post creating the user I'm redirecting my page to backendaddress/api/login which gives a jwt.
On React End
- I'm trying to create a button which redirects user to backend once SSO is completed then redirect back to react frontend with access token and refresh token to save in cookies or local storage.
Need few suggestions on react end how I can go ahead with this flow or if you have nay way to optimize the flow as well then please let me know.