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

传入配置时 appID 能否改为 clientID ? #23

Open
flight9 opened this issue Apr 18, 2018 · 3 comments
Open

传入配置时 appID 能否改为 clientID ? #23

flight9 opened this issue Apr 18, 2018 · 3 comments

Comments

@flight9
Copy link

flight9 commented Apr 18, 2018

在与其他项目整合时, 比如: https://github.com/feathersjs/authentication-oauth2

问题 1

他们使用的是 clientID 和 clientSecret:

app.configure(oauth2({
  name: 'facebook',
  Strategy: FacebookStrategy,
  clientID: '<your client id>',
  clientSecret: '<your client secret>',
  scope: ['public_profile', 'email']
}));

我们项目上用 appID, appSecret
这样命名上不一致在配置时可能出错, 是否可以考虑和他们统一?

@flight9
Copy link
Author

flight9 commented Apr 18, 2018

问题2

代码中

self._verify(req, params['access_token'], params['refresh_token'], profile, params['expires_in'], verified);

第5个参数为何是传入 expires_in 而不是 done 函数?

@Jeff-Tian
Copy link
Contributor

问题2

代码中

self._verify(req, params['access_token'], params['refresh_token'], profile, params['expires_in'], verified);

第5个参数为何是传入 expires_in 而不是 done 函数?

你说的 done 函数,在这里就是 verified 函数吧。

在与其他项目整合时, 比如: https://github.com/feathersjs/authentication-oauth2

问题 1

他们使用的是 clientID 和 clientSecret:

app.configure(oauth2({
  name: 'facebook',
  Strategy: FacebookStrategy,
  clientID: '<your client id>',
  clientSecret: '<your client secret>',
  scope: ['public_profile', 'email']
}));

我们项目上用 appID, appSecret
这样命名上不一致在配置时可能出错, 是否可以考虑和他们统一?

这个可以自行 map 一下解决掉吧。

@Jeff-Tian
Copy link
Contributor

image

在接入 egg-passport-xxx 时,碰到这种 map 是很常见的。

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