Error fetching info from OAuth2 provider

I started work on a React Native project about a week ago and originaly just set it up with email and password login, that works find but after trying to set up Google Sign In I’ve hit a bit of a roadblock.

It seems to be able to work when I have OpenID Connect turned on, but I would like to be able to recieve the meta data when a user signs up. I’m able to log out my meta data so its getting passed making the request to Google, but below is the error I’m getting;

Any suggestions are welcome as I’m out of ideas!

2 Likes

Following the thread, as I am looking into this as well.

1 Like

I wasn’t able to figure out whether you were using OpenID connect or not. If you are using OpenID, then metadata isn’t something Realm provides

Same issue as OP. I could not get Google Sign In working until I turned on OpenID Conenct in the realm authentication provider portal. Once I turned on OpenID Connect everything worked fine, but I could not get it to work without this.

I was fine with that setting, so I moved forward without much investigation. I no longer have the error messages or steps to replicate the problem. I am only posting this reply here in case others who are experiencing the same issue know to try turning on OpenID Connect through the Realm portal.

1 Like

I’ve also experienced the same issue. I cannot use Google provider unless I check that “OpenID Connect” option in the Authentication Providers tab. That way I’m not able to get user information like the email address, profile photo etc. I can just see the full name and nothing else.

Not sure if anyone has a solution for this problem, it would be much appreciated. :slight_smile:

I’m having the same issue. I really need the email address. I submitted a bug report on Github, but no solution there, either.

1 Like

Not sure if we have to enable some special permission inside a Google Cloud Platform project itself, in order to get some additional user info except the name…?

@111757 I submitted a bug report to the developers and they gave me a workaround that allows us to get the email + other personal info from Google. You can read desistefanova’s solution here.

It just requires switching to authenticating with JWT, which Google accepts.

1 Like

I started working on authtentication providers, I choose Bahrain free tier, but when I wanted to sync I was not allowed, since in Bahrain its not suppored. so I deleted the app, and db, created one in europe, and then now im getting the same error as you.

I cannot login anymore. I dont know if this has to do with the location, or another thing.

I’m not sure if the data location would have anything to do with this. But switching from google login to JWT login worked for me, because the google login is still buggy. Are you using JWT?: https://www.mongodb.com/docs/atlas/device-sdks/web/authenticate/#std-label-web-login-custom-jwt

@Noora_Chahine Why would I use JWT login when I need to login using facebok???

Why the data location worked, dont ask me, but it was working on that location.