egg-passport-citi
v1.11.1
Published
Citi passport plugin for egg
Downloads
29
Maintainers
Readme
egg-passport-citi
Citi passport plugin for egg.
Example
Open https://uniheart.herokuapp.com/passport/citi to see the result.
Install
$ npm i egg-passport-citi --save
Usage
// {app_root}/config/plugin.[t|j]s
exports.passportCiti = {
enable: true,
package: "egg-passport-citi"
};
Configuration
// {app_root}/config/config.default.[t|j]s
exports.passportCiti = {
key: "your oauth key",
secret: "your oauth secret",
callbackURL: "/your/callback-or-redirect/url",
// state: your customized state function, default to uuid()
state: function yourStateFunction(ctx) {}
};
Mount on your app
// {app_root}/app/router.ts
import { Application } from "egg";
export default (app: Application) => {
app.passport.mount("citi", app.config.passportCiti);
};
see config/config.default.ts for more detail.
Example
- http://uniheart.pa-ca.me/passport/citi
- https://jeff-tian.github.io/me/
Testing Accounts:
| User ID | Password | | :----------: | :--------: | | SandboxUser1 | P@ssUser1$ | | SandboxUser2 | P@ssUser2$ | | SandboxUser3 | P@ssUser3$ | | SandboxUser4 | P@ssUser4$ | | SandboxUser5 | P@ssUser5$ |
License
Test
npm run test-local