Citi passport plugin for egg.
Open https://uniheart.herokuapp.com/passport/citi to see the result.
$ npm i egg-passport-citi --save
// {app_root}/config/plugin.[t|j]s
exports.passportCiti = {
enable: true,
package: "egg-passport-citi"
};
// {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) {}
};
// {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.
Testing Accounts:
User ID | Password |
---|---|
SandboxUser1 | P@ssUser1$ |
SandboxUser2 | P@ssUser2$ |
SandboxUser3 | P@ssUser3$ |
SandboxUser4 | P@ssUser4$ |
SandboxUser5 | P@ssUser5$ |
npm run test-local