2016-11-23 125 views
2

嘿,大家好日子我有奇怪的問題使用谷歌身份驗證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。

回答

1

您確定您提供給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彈出該錯誤。 –