Closed TadasMil closed 2 years ago
@TadasMil
Thank you for reporting. I have a couple of follow-up questions.
GoogleAuth.initialize()
, did you set grantOfflineAccess
to false or true?@kneth Sorry for a late response.
1.7.1
version of realm-web
.grantOfflineAccess
as true
and as false
.I think the issue is server-side. I don't know if https://www.mongodb.com/community/forums/t/error-fetching-info-from-oauth2-provider/116780 can help you. Otherwise I suggest you raise a proper support ticket - see https://support.mongodb.com/?_ga=2.190708203.1130835416.1663574736-25634361.1661946744
I am closing the issue due to no updates. Please comment and reopen the issue if needed.
How frequently does the bug occur?
All the time
Description
My main goal is to integrate google log in and store user details inside realm. As of now, following realm docs I'm not able to
logIn
user.I've followed the guide here, and I'm not able to complete the
logIn
part.I found multiple registered issues regarding this problem:
This 2nd issue is pretty similar to mines, but I get different response error message. This even presents to use a solution for redirect-url.
1. Is there any other way to outcome this without passing a
url
toCredentials.google
? 2. Maybe I should authenticate user using firebase and use realm for data storage? Because its been quiet along and the issue still persists.Any other recommendation would be appreciated
Stacktrace & log output
Inside logs of realm I see this:
Can you reproduce the bug?
Yes, always
Reproduction Steps
I followed this guide to for realm login here and adopted to my env.
@codetrix-studio/capacitor-google-auth
complete the setup part for setting upclient Id
where its needed. This will retrieve google user object. For web, you want to initialize theGoogleAuth
. For android, you will have to take additional setup with sha key.realm-web
and insidemain.ts
initialize realm app usingnew Realm.App({ id: appId })
.Setup code and run it
const signInWithGoogle = async () => { const response = await GoogleAuth.signIn(); const { idToken } = response.authentication;
const credentials = Realm.Credentials.google({ idToken });
realm.logIn(credentials) .then((user) => { console.log(
Logged in with id: ${user.id}
); }); };### VersionWhat SDK flavour are you using?
Atlas Device Sync
Are you using encryption?
No, not using encryption
Platform OS and version(s)
Web, Android
Build environment
Which debugger for React Native: ..
Cocoapods version
No response