aadd
This commit is contained in:
parent
32040f4457
commit
413e46ce14
|
@ -1,15 +1,38 @@
|
||||||
import { Configuration } from 'oidc-provider';
|
import { Configuration } from 'oidc-provider';
|
||||||
|
import { nanoid } from 'nanoid';
|
||||||
|
|
||||||
const config: Configuration = {
|
const config: Configuration = {
|
||||||
clients: [
|
clients: [
|
||||||
{
|
{
|
||||||
client_id: 'example-client',
|
client_id: 'example-client',
|
||||||
client_secret: 'example-secret',
|
client_secret: 'example-secret',
|
||||||
grant_types: ['authorization_code'],
|
grant_types: ['authorization_code', 'refresh_token'],
|
||||||
redirect_uris: ['http://localhost:3000/cb'],
|
redirect_uris: ['http://localhost:3000/callback'],
|
||||||
|
response_types: ['code'],
|
||||||
|
scope: 'openid email profile',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
pkce: {
|
||||||
|
required: () => true, // 要求所有客户端使用PKCE
|
||||||
|
},
|
||||||
|
features: {
|
||||||
|
devInteractions: { enabled: false }, // 禁用开发交互界面
|
||||||
|
resourceIndicators: { enabled: true }, // 启用资源指示器
|
||||||
|
revocation: { enabled: true }, // 启用令牌撤销
|
||||||
|
userinfo: { enabled: true }, // 启用用户信息端点
|
||||||
|
},
|
||||||
|
cookies: {
|
||||||
|
keys: [nanoid()], // 用于签署和验证cookie
|
||||||
|
},
|
||||||
|
jwks: {
|
||||||
|
keys: [], // 在实际环境中应该生成并保存密钥
|
||||||
|
},
|
||||||
|
ttl: {
|
||||||
|
AccessToken: 3600, // 1小时
|
||||||
|
AuthorizationCode: 600, // 10分钟
|
||||||
|
IdToken: 3600, // 1小时
|
||||||
|
RefreshToken: 1209600, // 14天
|
||||||
},
|
},
|
||||||
],
|
|
||||||
// 其他配置项...
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export default config;
|
export default config;
|
Loading…
Reference in New Issue