【发布时间】:2018-03-08 06:42:33
【问题描述】:
我真的很难让用户在我的 Xamarin 移动应用程序中注册和确认工作。我已经得到了注册请求,并且用户成功地出现在用户池中为未确认。但是,当我尝试关注 this general guide(当我使用 Xamarin 时,该指南专门针对 Android,并且通过扩展,C#)我在调用 ConfirmSignUpAsync 方法时收到 NotAuthorizedException。
总的来说,我是 Amazon Web Services 的新手,我认为我可能有一些设置或角色配置错误,这阻碍了我确认用户。具体来说,我认为我需要用户池的应用程序客户端设置部分的帮助。我认为这些不会引起问题,因为我的印象是您不需要任何身份验证来注册和确认用户。这是我目前在这些设置中的内容:
这是我尝试使用验证码确认电子邮件地址的代码:
public async Task<Exception> VerifyEmail(String sUsername, String sVerificationCode)
{
CognitoAWSCredentials oCreds = new CognitoAWSCredentials(sIdentityPoolID, Amazon.RegionEndpoint.USEast2);
AmazonCognitoIdentityProviderClient oClient = new AmazonCognitoIdentityProviderClient(oCreds, Amazon.RegionEndpoint.USEast2);
CognitoUserPool oUserPool = new CognitoUserPool(sUserPoolID, sClientID, oClient);
CognitoUser oCognitoUser = new CognitoUser(sUsername, sClientID, oUserPool, oClient);
try
{
await oCognitoUser.ConfirmSignUpAsync(sVerificationCode, false);
return null;
}
catch (Exception e)
{
return e;
}
}
【问题讨论】:
标签: amazon-web-services xamarin amazon-cognito