Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Sign On - Scheme as redirect_uri, Access Blocked (Security) #419

Closed
MayoudP opened this issue Jun 13, 2023 · 2 comments
Closed

Google Sign On - Scheme as redirect_uri, Access Blocked (Security) #419

MayoudP opened this issue Jun 13, 2023 · 2 comments

Comments

@MayoudP
Copy link

MayoudP commented Jun 13, 2023

Which platform(s) does your issue occur on?

  • iOS
  • iOS 16.4
  • iPhone 14 Plus

Please, provide the following version numbers that your issue occurs with:

  • CLI: 8.0.7
  • Plugin(s):
"react-native": "0.69.8",
"react-native-inappbrowser-reborn": "^3.6.3",

Please, tell us how to recreate the issue in as much detail as possible.

-> Use openAuth() with Google Sign On.

Is there any code involved?

Hello, I'm trying to do Google Sign On on my mobile application. The first flow is going well, however I'm having issue with redirection to my app, it's triggering an error.
Basically, after the first call, I managed to retrieve the first URL : firstUrl = https://accounts.google.com/o/oauth2/v2/auth?client_id=.... Regarding redirect_uri, I jut did encodeURIComponent('my_app'), meaning that in the URL, I've something like &redirect_uri=my_app.
Then with the react-native project, I'm doing :

RNInAppBrowser.openAuth(firstUrl, 'my_app', {
 ...iOSProperties,
 ...androidProperties,
 ...animationProperties,
 forceCloseOnRedirection: true,
 })

When launching all of this, I'm having this screen :

J

I'm pretty sure it's an issue with credentials setup on google cloud console. And I need to setup my "scheme" as accepted redirection, but I don't find such available configuration for iOS application OAuth 2.0...

Thank you for the help, I'm pretty sure it's a straightforward error, thanks for the help.

@MayoudP
Copy link
Author

MayoudP commented Jun 23, 2023

I found something.
I basically switched my Client ID from Google oauth2.0 ID's (which was originally for a Client Web) to an iOS Client Oauth2.0.

And in the redirect_url in backend side, and in the openAuth as scheme my com.package.app:// matching the iOS client ID's. Just like that. SO in a way problem fixed, but...
However, can't I use client web to do that ? I mean, I'm opening an in-app browser opening a WebView Like, should be doable no ?

@MayoudP
Copy link
Author

MayoudP commented Jul 19, 2023

I did a redirection to my web client. And on my web app trigger window.location.assign(myapp:// to force the redirection to my app. It works.

@MayoudP MayoudP closed this as completed Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant