i5-Toolkit-for-Unity icon indicating copy to clipboard operation
i5-Toolkit-for-Unity copied to clipboard

OpenID Connect Client - redirect uri invalid request

Open kk3hi3123 opened this issue 7 months ago • 2 comments

Describe the bug I had followed this video to set up Google Sign In using i5 toolkit. And I followed the deep linking instruction to add i5 as scheme in AndroidManifest.xml.

Image

And this is how I set the redirect uri:

Image

But when I build the apk and try to sign in with Google, error message comes out: You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy for keeping apps secure.

And after clicking into the error details, it shows: Error 400: invalid_request redirect_uri=i5:/code?flowName=GeneralOAuthFlow

Expected behavior Showing the page for user to Google sign.

Screenshots Image

Bug Observed on the Following Build Targets Check applicable build targets by putting an x in-between the square brackets.

  • [ ] Unity editor
  • [ ] PC, Mac, Standalone
  • [ ] Universal Windows Platform (UWP)
  • [ ] iOS
  • [x] Other (please specify): Android

For deployed applications, please provide information about the device on which the bug occurred Device name (e.g. Google Pixel): Xiaomi Mi Max 3 OS version (e.g. Android 11, iOS 14): Android 10

kk3hi3123 avatar Apr 17 '25 04:04 kk3hi3123

I'm facing a similar problem

OpenIDConnectService openIDConnectService = new OpenIDConnectService(); openIDConnectService.OidcProvider = new GoogleOidcProvider(); openIDConnectService.OidcProvider.ClientData = googleClientEditorDataObject.clientData; openIDConnectService.RedirectURI = "https://www.google.com"; openIDConnectService.ServerListener.ListeningUri = "http://127.0.0.1:52229/"; ServiceManager.RegisterService(openIDConnectService); ServiceManager.GetService<OpenIDConnectService>().OpenLoginPageAsync();

Image

Image

Captain-SeaL avatar May 21 '25 08:05 Captain-SeaL

i remove redirect url to see what happends and it send by default on 62553 port so i change authorized url for http://127.0.0.1:62553/code? and openIDConnectService.ServerListener.ListeningUri = "http://127.0.0.1:62553/"; and it works i think it something wrong with port can be

Captain-SeaL avatar May 21 '25 09:05 Captain-SeaL