【发布时间】:2022-08-02 15:56:53
【问题描述】:
以下是我对 oidc 提供程序的配置。 我在功能下添加了资源指标。但它根本不起作用。如何在 authentication_code 工作流程中使用 node-oidc-provider 颁发 JWT 访问令牌?
提供程序版本为 7.11.4。
clients: [
{
client_id: \'0oa5pa23mzKPWYtvV5d7\',
redirect_uris: [\'https://jwt.io\', \'http://localhost:3000/login/callback\'], // using jwt.io as redirect_uri to show the ID Token contents
response_types: [\'code\'],
application_type: \'web\',
token_endpoint_auth_method: \'none\',
scope: \'openid offline_access profile email\',
grant_types: [\'authorization_code\', \'refresh_token\'],
},
],
routes: {
authorization: \'/oauth2/v1/authorize\',
token: \'/oauth2/v1/token\',
revocation: \'/oauth2/v1/revoke\',
userinfo: \'/oauth2/v1/userinfo\',
},
clientBasedCORS(ctx, origin, client) {
if (client.clientId === \'0oa5pa23mzKPWYtvV5d7\' && origin === \'http://localhost:3000\') {
return true;
}
return false;
},
pkce: {
required: () => true,
},
interactions: {
url(ctx, interaction) { // eslint-disable-line no-unused-vars
return `/interaction/${interaction.uid}`;
},
},
cookies: {
keys: [\'some secret key\', \'and also the old rotated away some time ago\', \'and one more\'],
},
claims: {
address: [\'address\'],
email: [\'email\', \'email_verified\'],
phone: [\'phone_number\', \'phone_number_verified\'],
profile: [\'birthdate\', \'family_name\', \'gender\', \'given_name\', \'locale\', \'middle_name\', \'name\',
\'nickname\', \'picture\', \'preferred_username\', \'profile\', \'updated_at\', \'website\', \'zoneinfo\'],
},
features: {
resourceIndicators: {
getResourceServerInfo: () => ({
audience: \'solid\',
accessTokenTTL: 2 * 60 * 60, // 2 hours
accessTokenFormat: \'jwt\',
jwt: {
sign: { alg: \'ES256\' },
},
}),
},
},