Skip to content
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

Merged
merged 5 commits into from
Jan 22, 2024
Merged

feat: login / logout with oidc #11

merged 5 commits into from
Jan 22, 2024

Conversation

Vsion
Copy link
Collaborator

@Vsion Vsion commented Jan 19, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • 💄 style
  • 🔨 chore
  • 📝 docs

🔀 变更说明 | Description of Change

login / logout with oidc

📝 补充信息 | Additional Information

@yunti-bot
Copy link

👍 @Vsion


Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

@Vsion Vsion mentioned this pull request Jan 19, 2024

export default {
AUTH_DATA: 'authData',
server: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oidc 这些配置需要支持通过环境变量之类的方式配置

},
client: {
client_id: 'bff-client',
client_secret: '61324af0-1234-4f61-b110-ef57013267d6',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个是 secret 是比较敏感的,期望不要打包到前端代码里

Copy link
Collaborator Author

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,
},
};
Copy link
Collaborator

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 放在前端的常量里就可以了,前后端需要分离清楚些

@Carrotzpc Carrotzpc merged commit fa0440a into kubeagi:main Jan 22, 2024
2 checks passed
@yunti-bot
Copy link

❤️ Great PR @Vsion ❤️


The growth of project is inseparable from user feedback and contribution, thanks for your contribution!
项目的成长离不开用户反馈和贡献,感谢您的贡献!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants