【发布时间】: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