1.5.2 • Published 4 years ago

passport-citi v1.5.2

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

passport-citi

Passport strategy for authenticating with Citi Account

Dependencies Build Status

Quality gate

支持功能

在线演示

安装

npm install passport-citi --save

使用

Configure Strategy

 passport.use(new CitiStrategy({
        appID: {APPID},
        name:{默认为wechat,可以设置组件的名字}
        appSecret: {APPSECRET},
        client:{wechat|web},
        callbackURL: {CALLBACKURL},
        scope: {snsapi_userinfo|snsapi_base},
        state:{STATE},
        getToken: {getToken},
        saveToken: {saveToken}
      },
      function(accessToken, refreshToken, profile,expires_in, done) {
        return done(err,profile);
      }
));

The `callbackURL`, `scope` and `state` can be overwritten in `passport.authenticate` middleware.

The `getToken` and `saveToken` can be provided to initialize Wechat OAuth instance.

Authenticate Requests

router.get("/auth/citi", passport.authenticate("citi", options));

options - Optional. Can include the following:

  • state - Override state for this specific API call
  • callbackURL - Override callbackURL for this specific API call
  • scope - Override scope for this specific API call

If no callbackURL is specified, the same request url will be used.

Authentication Callback

router.get(
  "/auth/citi/callback",
  passport.authenticate("citi", {
    failureRedirect: "/auth/fail",
    successReturnToOrRedirect: "/"
  })
);

License

Copyright (c) 2014 liangyali
Licensed under the MIT license.

1.5.2

4 years ago

1.5.1

4 years ago

1.5.0

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago