【问题标题】:Google Authentication using Cognito and Xamarin forms使用 Cognito 和 Xamarin 表单的 Google 身份验证
【发布时间】:2020-08-03 20:19:19
【问题描述】:

在解决我的问题后,我进行了广泛搜索,但似乎找不到任何问题。我的问题是我需要在 AWS Cognito 的帮助下创建一个 google-authenticator。对于任何其他编程语言,似乎都有一个简单的解决方案,但对于我编写它的 Xamarin 表单,似乎根本没有文档。所以我现在在这里与您联系,看看是否有人可以帮助我解决我的问题。 我应该按一个按钮并重定向到谷歌登录页面,然后从谷歌取回数据。这就是我目前所得到的。

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;
    } 
}

这是我迄今为止想出的,但我似乎无法弄清楚其余的。非常感谢答案。

【问题讨论】:

    标签: c# xamarin.forms amazon-cognito


    【解决方案1】:

    您是否尝试过使用 Xamarin Essentials Web Authenticator?

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

    AWS 提供了一个托管的 Web UI 女巫处理一个非常酷的解决方案,通过社交进行身份验证。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-25
      • 1970-01-01
      • 1970-01-01
      • 2018-05-22
      相关资源
      最近更新 更多