1개 답변
- 최신
- 최다 투표
- 가장 많은 댓글
0
The AWS JWT Verify library available on npm and source on GitHub does this.
JavaScript library for verifying JWTs signed by Amazon Cognito, and any OIDC-compatible IDP that signs JWTs with RS256 / RS384 / RS512.
Below is a basic usage example from the README, but there are other supported parameters and configuration options.
import { CognitoJwtVerifier } from "aws-jwt-verify"; // Verifier that expects valid access tokens: const verifier = CognitoJwtVerifier.create({ userPoolId: "<user_pool_id>", tokenUse: "access", clientId: "<client_id>", }); try { const payload = await verifier.verify( "eyJraWQeyJhdF9oYXNoIjoidk..." // the JWT as string ); console.log("Token is valid. Payload:", payload); } catch { console.log("Token not valid!"); }
답변함 2달 전
관련 콘텐츠
- AWS 공식업데이트됨 7달 전
- AWS 공식업데이트됨 2년 전
- AWS 공식업데이트됨 일 년 전
Thanks for that, I didn’t manage to find a similar library for Go though, I suspect it’s a custom implementation for Type/JavaScript only?