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

暴露 client secret 的问题 #185

Open
handsomecheung opened this issue May 1, 2019 · 0 comments
Open

暴露 client secret 的问题 #185

handsomecheung opened this issue May 1, 2019 · 0 comments

Comments

@handsomecheung
Copy link

既然请求 proxy server 是不能避免的(因为 CORS Header),那可以在 proxy server 提供加密接口,通过 host 和 passphrase 加密 client secret,在获取 access token 时,仅提供 encoded client secret 即可,proxy server 通过 Referer 和内置的 passphrase 解密 encoded client secret 后转发给 github API。

虽然 Referer 也可以伪造,但应该能在一定程度上防止 client secret 被恶意使用。而且获取 access token 必须经过 proxy server,所有恶意请求也都能被追溯以及控制。

不知道这个方案如何?

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

No branches or pull requests

2 participants
@handsomecheung and others