Skip to content

Commit

Permalink
Merge pull request #36 from meiling-gatekeeper/staging
Browse files Browse the repository at this point in the history
0.8.4 Release
  • Loading branch information
Alex4386 authored Feb 13, 2022
2 parents 9a26ab9 + 031e1f9 commit 3d8276b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "meiling",
"version": "0.8.3",
"version": "0.8.4",
"description": "An easy-to-use, open-source, flexible oAuth2 Authentication Provider and OpenID Connect Server",
"main": "dist/",
"repository": "https://github.com/meiling-gatekeeper/meiling",
Expand Down
6 changes: 6 additions & 0 deletions src/routes/v1/oauth2/tokeninfo/id_token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ export async function idTokenInfoHandler(token: string, rep: FastifyReply): Prom
}
: config.openid.jwt.publicKey.key;

let algorithm = config.openid.jwt.algorithm as JWT.Algorithm;
if ((algorithm as string) === 'ES256K') {
algorithm = 'ES256';
}

const result = JWT.verify(token, key, {
issuer: config.openid.issuingAuthority,
algorithms: [algorithm],
}) as any;

if (new Date(result.exp).getTime() < new Date().getTime()) {
Expand Down

0 comments on commit 3d8276b

Please sign in to comment.