include client in id token issue

This commit is contained in:
Evert Prants 2022-09-16 17:36:13 +03:00
parent aef42b6638
commit 8cd0498db4
Signed by: evert
GPG Key ID: 1688DA83D222D0B5
4 changed files with 10 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@icynet/oauth2-provider", "name": "@icynet/oauth2-provider",
"version": "1.0.2", "version": "1.0.3",
"description": "OAuth2.0 Provider for Icy Network", "description": "OAuth2.0 Provider for Icy Network",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View File

@ -208,6 +208,7 @@ export const authorization = wrap(async (req, res) => {
data = await oauth2.model.jwt.issueIdToken( data = await oauth2.model.jwt.issueIdToken(
user, user,
client,
scope, scope,
redirectUri, redirectUri,
req.query.nonce as string | undefined req.query.nonce as string | undefined

View File

@ -116,7 +116,13 @@ export async function authorizationCode(
); );
try { try {
respObj.id_token = await oauth2.model.jwt.issueIdToken(user, cleanScope, undefined, code.nonce); respObj.id_token = await oauth2.model.jwt.issueIdToken(
user,
client,
cleanScope,
undefined,
code.nonce
);
} catch (err) { } catch (err) {
oauth2.logger.error(err); oauth2.logger.error(err);
throw new ServerError('Failed to issue an ID token'); throw new ServerError('Failed to issue an ID token');

View File

@ -327,6 +327,7 @@ export interface JWTAdapter {
*/ */
issueIdToken: ( issueIdToken: (
user: OAuth2User, user: OAuth2User,
client: OAuth2Client,
scope: string[], scope: string[],
redirectUri?: string, redirectUri?: string,
nonce?: string nonce?: string