首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Cognito和Xamarin表单的Google身份验证

使用Cognito和Xamarin表单的Google身份验证
EN

Stack Overflow用户
提问于 2020-04-21 14:52:41
回答 1查看 163关注 0票数 1

我到处寻找我的问题的解决方案,但似乎没有找到任何解决方案。我的问题是,我需要在AWS Cognito的帮助下创建一个google-authenticator。对于任何其他编程语言,似乎都有一个简单的解决方案,但是对于我用来编写它的Xamarin表单,似乎根本没有文档。因此,我现在联系您,看看是否有人可以帮助我解决我的问题。我应该按下一个按钮,然后被重定向到google登录页面,然后从google取回数据。这就是我到目前为止所得到的。

代码语言:javascript
复制
void OnGoogleLoginClicked(object sender, EventArgs e)
{
    Amazon.CognitoIdentity.CognitoAWSCredentials credentials = new Amazon.CognitoIdentity.CognitoAWSCredentials(
        "eu-west-2:580dbdc0-4979-4a25-a4ab-7dc90d7f2a2d", // Identity pool ID
        Amazon.RegionEndpoint.EUWest2 // Region
        );

    string googleClientId = null;
    string googleRedirect = null;

    switch (Device.RuntimePlatform)
    {
        case Device.iOS:
            googleClientId = Constants.GoogleClientId;
            googleRedirect = Constants.GoogleRedirectUrl;
            break;
        case Device.Android:
            googleClientId = Constants.GoogleClientId;
            googleRedirect = Constants.GoogleRedirectUrl;
            break;
    } 
}

到目前为止,这就是我想出的方法,但我似乎想不出其余的方法。答案得到了极大的重视。

EN

回答 1

Stack Overflow用户

发布于 2020-11-12 10:10:16

你有没有试过使用Xamarin Essentials网络验证器?

您可以将webauthenticatorAWS托管的Web一起使用。

AWS提供了一个托管的Web,它用一个相当酷的解决方案来处理通过社交进行身份验证的问题。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61337559

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档