有點多個問題,但是,Amazon Cognito AuthFlow
如何在.NET中使用Amazon Cognito用戶池執行身份驗證。 我發起驗證下列要求:
var response1 = client.InitiateAuth(new InitiateAuthRequest()
{
AuthFlow = AuthFlowType.USER_SRP_AUTH,
AuthParameters = new Dictionary<string, string>()
{
{"USERNAME","User" },
{"SRP_A" , A }
},
ClientId = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
});
他們的文檔是真的,真的壞了,我似乎無法找到什麼傳遞時,我想應對挑戰。
client.RespondToAuthChallenge(new RespondToAuthChallengeRequest()
{
ChallengeName = ChallengeNameType.PASSWORD_VERIFIER,
ChallengeResponses = { /*WHAT am I supposed to add here, and where can I find any documnetation on what is expected?*/ },
Session = response1.Session,
ClientId = "xxxxxxxxxxxxx"
});
在一個側面說明,我想用Cognito聯合身份以保護自定義.NET API,所以我的想法是使用令牌返回由Cognito作爲JWT傳遞到的WebAPI的一面,我在那裏然後將解碼並驗證令牌。這是使用Amazon Cognito的預期方式嗎? (至少現在我不想使用亞馬遜API網關)。
我假設它只是配置默認的JWT中間件的OWIN,或者我應該預期別的嗎?
你側面說明基本上是正確的:用戶池給你非常相似的JWT令牌作爲谷歌等......,並以同樣的方式被身份池使用。 –
關於SRP [這是一種標準算法](https://en.wikipedia.org/wiki/Secure_Remote_Password_protocol),但我還沒有用C#與Cognito合作。 –