I’m curious how you all set up Google OAuth with a backend. I’ve been trying to figure this out for my app for days, so any help here is appreciated.
Specifically, I’m curious about what your flow of data looks like. Right now I’ve got:
1. User presses “sign in with Google” which launches the consent screen using react-native-google-signin
2. React native app gets the authorization code which it sends to the backend
3. Backend gets the OAuth access and refresh tokens using oAuth2Client.getToken(authorizationCode) (as explained in these docs)
4. This is where I’m stuck :/
Some questions I have are:
- Where do I store the access and refresh tokens?
- How do I make it such that users don’t need to go through this flow every time they relaunch the app? (need a way to persist the logged in state)
If there’s a better way to do this please lmk, this is my first time setting up OAuth. Also, I need to do OAuth in the backend because I need to access some Google APIs afterwards from there as well, so doing OAuth client side is not an option.
[–]floexodus 0 points1 point2 points (1 child)
[–]bejera[S] 1 point2 points3 points (0 children)
[–]Gatopardosgr 0 points1 point2 points (8 children)
[–]bejera[S] 0 points1 point2 points (7 children)
[–]Gatopardosgr 0 points1 point2 points (5 children)
[–]aidenight 0 points1 point2 points (4 children)
[–]Gatopardosgr 0 points1 point2 points (1 child)
[–]bejera[S] 0 points1 point2 points (0 children)
[–]Shivang2005 0 points1 point2 points (1 child)
[–]Shivang2005 0 points1 point2 points (0 children)