正如标题中所述,我正在通过AdminInitiateAuth模式向Amazon Cloud进行身份验证,并且停留在“无法验证客户端的秘密哈希”上。我似乎在这里找不到我做错了什么,因此希望能有所帮助。这是一个简单的控制台应用程序,只是为了尝试连接到它。
//connection data
public const string User
public const string Password
public const string UserPoolId
public const string AppClientId
public const string AppClientSecret
public const string AccessKey
public const string SecretKey
static void Main(string[] args)
{
var client = new AmazonCognitoIdentityProviderClient(AccessKey, SecretKey, RegionEndpoint.EUCentral1);
var parameters = new Dictionary<string, string> {{"USERNAME", User}, { "SECRET_HASH", SecretKey }, {"PASSWORD", Password}};
client.AdminInitiateAuth(new AdminInitiateAuthRequest
{
AuthFlow = AuthFlowType.ADMIN_NO_SRP_AUTH,
UserPoolId = UserPoolId,
ClientId = AppClientId,
AuthParameters = parameters
});
System.Console.WriteLine("Worked");
System.Console.ReadKey();
}