-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: login / logout with oidc #11
Conversation
👍 @Vsion |
|
||
export default { | ||
AUTH_DATA: 'authData', | ||
server: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oidc 这些配置需要支持通过环境变量之类的方式配置
src/config/oidc.mjs
Outdated
}, | ||
client: { | ||
client_id: 'bff-client', | ||
client_secret: '61324af0-1234-4f61-b110-ef57013267d6', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是 secret 是比较敏感的,期望不要打包到前端代码里
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已修改, 改为从 process.env.OIDC_SERVER_URL env 获取
.env.development or .env.production
相关文档 https://nextjs.org/docs/app/building-your-application/configuring/environment-variables
client_secret: process.env.CLIENT_SECRET, | ||
redirect_uri: process.env.CLIENT_REDIRECT_URI, | ||
}, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
构建打包后,前端文件里 client_id
这些字段是不是就固定了,还能通过环境变量指定吗?还是说 next.js 有啥特殊处理,建议 oidc 的这些请求都在 next.js 后端完成,包括跳转 u4a 登录这些,这些参数不需要暴露给前端,AUTH_DATA
放在前端的常量里就可以了,前后端需要分离清楚些
❤️ Great PR @Vsion ❤️ |
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
login / logout with oidc
📝 补充信息 | Additional Information