Xamarin.Auth2使用谷歌身份验证错误redirect_uri_mismatch

问题描述:

嘿,大家好日子我有奇怪的问题使用谷歌身份验证Xamarin.OAuth2。登录可以进行身份​​验证,但似乎Xamarin.Auth收到谷歌的无效响应。当我在Google Chrome https://accounts.google.com/o/oauth2/auth中使用此URL进行测试时,它会将页面重定向到mysite URL,但使用该应用程序时,我会收到此错误redirect_uri_mismatch。Xamarin.Auth2使用谷歌身份验证错误redirect_uri_mismatch

enter image description here

为我用活网站重定向URL。

您确定您提供给Xamarin Auth初始化的重定向URI是否与您在Google Developer Console中添加的重定向URI相匹配授权重定向URI

例如,下面https://mysite.domain.net/应该是相同的重定向在授权的重新导向URI的上市URI的谷歌开发者控制台网站上领域:

Xamarin.Auth.OAuth2Authenticator auth = new Xamarin.Auth.OAuth2Authenticator(
    "560741372047-t00000000000v4vf0nvp0o7aqbu94.apps.googleusercontent.com", 
    "sHqEPlKg0000000000iP1x", 
    "openid email", 
    new System.Uri("https://accounts.google.com/o/oauth2/auth"), 
    new System.Uri("https://mysite.domain.net/"), 
    new System.Uri("https://accounts.google.com/o/oauth2/token")); 
+0

邑是你不会得到认证屏幕,如果它不匹配。 –

+0

登录成功后,将您重定向至确认DENY或允许,当我点击允许DisplayAlert弹出该错误。 –