Setup Web Authenticator in Xamarin Essentials for local Android development

巧了我就是萌 提交于 2021-02-11 05:56:43

问题


I am trying to setup development environment to integrate Google sign-in on Android using Web Authenticator in Xamarin Essentials.

  1. In the Web API project, same AuthController is included described in this article. It is running on https://localhost:44311/api

  2. To call the API from emulator, API url is referenced as https://10.0.2.2:43411/api as described in this article.

  3. Now, I am able to call the API url using await WebAuthenticator.AuthenticateAsync(apiUrl, callbackUrl)

  4. But, when API tries to invoke Google authentication via await Request.HttpContext.ChallengeAsync(scheme);, below error is returned from Google.

Error 400: invalid_request, device-id and device-name are required for the private IP: https://10.0.2.2:4311/signin-google

  1. As I understand, it is expecting request originated from the server instead of IP address like https://<servername>

  2. Whole situation comes down to be able to access the webservice using name (or localhost) to be used in both emulator and Google redirect uri.

来源:https://stackoverflow.com/questions/61905112/setup-web-authenticator-in-xamarin-essentials-for-local-android-development

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!