Xamarin.Auth - 对firebase的google身份验证

时间:2016-08-11 10:31:16

标签: c# xamarin firebase google-authentication xamarin.auth

我正在尝试使用xamarin.auth通过其Google帐户验证用户身份。一切正常,我也从谷歌获得访问令牌,但我得到一个弹出窗口说  **身份验证错误 - invalid_grant ** 然后它再次重新加载谷歌登录页面。

 void OnAuthenticationCompleted(object sender, AuthenticatorCompletedEventArgs e)
    {
        if (e.IsAuthenticated)
        {
            //yay
        }
    }

e.IsAuthenticated为true,接收到访问令牌。

这是我提供给oauth2authenticator实例的详细信息

private const string ClientId = "mywebappclientid";//auto generated by firebase
    private const string ClientSecret = "mysecret";
    private const string Scope = "https://www.googleapis.com/auth/userinfo.email";
    private const string AuthorizeUrl = "https://accounts.google.com/o/oauth2/auth";
    private const string RedirectUrl ="https://myapp.firebaseapp.com/__/auth/handler";
    private const string AccessTokenUrl = "https://accounts.google.com/o/oauth2/token";

0 个答案:

没有答案