include client in id token issue
This commit is contained in:
parent
aef42b6638
commit
8cd0498db4
@ -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",
|
||||||
|
@ -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
|
||||||
|
@ -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');
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user