怎么验证由Cognito Identity Pool生成的OpenId连接令牌

0

【以下的问题经过翻译处理】 我有一个客户,他正在结合Cognito Identity Pool和Cognito User Pool一起使用。他正在使用API方法GetOpenId Token为未经身份验证的用户生成JWT令牌,并希望在后端验证JWT令牌。

https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetOpenIdToken.html

然而,这似乎仅适用于由user pool生成的令牌,请参阅:

https://aws.amazon.com/premiumsupport/knowledge-center/decode-verify-cognito-json-token/

我的问题是,identity pool的令牌也可以同样实现吗?在哪里可以找到用于验证JWT签名的公钥?

profile picture
EXPERTE
gefragt vor 6 Monaten23 Aufrufe
1 Antwort
0

【以下的回答经过翻译处理】 我自己没有尝试过,但如果它是符合 OIDC 标准的令牌,您应该能够通过官方验证过程进行验证,使用令牌中 iss 字段中的 jwks url 进行验证。

以下是如何进行验证的步骤:

profile picture
EXPERTE
beantwortet vor 6 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen