我到处寻找我的问题的解决方案,但似乎没有找到任何解决方案。我的问题是,我需要在AWS Cognito的帮助下创建一个google-authenticator。对于任何其他编程语言,似乎都有一个简单的解决方案,但是对于我用来编写它的Xamarin表单,似乎根本没有文档。因此,我现在联系您,看看是否有人可以帮助我解决我的问题。我应该按下一个按钮,然后被重定向到google登录页面,然后从google取回数据。这就是我到目前为止所得到的。
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;
}
}到目前为止,这就是我想出的方法,但我似乎想不出其余的方法。答案得到了极大的重视。
发布于 2020-11-12 10:10:16
你有没有试过使用Xamarin Essentials网络验证器?
您可以将webauthenticator与AWS托管的Web一起使用。
AWS提供了一个托管的Web,它用一个相当酷的解决方案来处理通过社交进行身份验证的问题。
https://stackoverflow.com/questions/61337559
复制相似问题