Dear All,
I’m creating mobile app using react-native. For regular login (email/password) already works. But, I want to add Google Seamless SSO.
After, choosing a google account and accept the permission request, it successful. But it can’t access another endpoints like /users/me because it didn’t have correct directus token. How to exchange from google token to directus token? Please help. TIA.
Google userInfo structure: {
“type”: “success”,
“data”: {
“scopes”: [
“``https://www.googleapis.com/auth/userinfo.profile”``,
“``https://www.googleapis.com/auth/userinfo.email”``,
“openid”,
“profile”,
“email”
],
“serverAuthCode”: “4/0AVMBsJi7Oj–redacted–p_xG_Ba9NtJViLWkoyXLyyklz6qPqs7P30kLgJL7bHKw”,
“idToken”: “eyJhbGciOiJSUzI1NiIsImtpZCI6IjE0OTljMTU0Y2NjOGEyNWUyNGQ4ZGU4YjFhOWY4NDVhZWZiNmYzY2EiLCJ0eXAiOiJKV1QifQ.eyJpc–redacted–tdP2S6HutKqzTqEAlItFCt9HuqfXDLFmnT4nIa9x_DXuLbaeg3o8TTJc6QvQ”,
“user”: {
“photo”: “``https://lh3.googleusercontent.com/a/ACg8ocIqgXsDHDSxNFQ5G8–redacted–4g=s96-c”``,
“givenName”: “Yo”,
“familyName”: null,
“email”: “yo–redacted–@gmail.com”,
“name”: “Yo”,
“id”: “10906–redacted–638106”
}
}
}