How to use the use function from passport-strategy

Find comprehensive JavaScript passport-strategy.use code examples handpicked from public code repositorys.

48
49
50
51
52
53
54
55
56
57
*   - `callbackURL`       URL to which the service provider will redirect the user after obtaining authorization
*   - `passReqToCallback` when `true`, `req` is the first argument to the verify callback (default: `false`)
*
* Examples:
*
*     passport.use(new OAuth2Strategy({
*         authorizationURL: 'https://www.example.com/oauth2/authorize',
*         tokenURL: 'https://www.example.com/oauth2/token',
*         clientID: '123-456-789',
*         clientSecret: 'shhh-its-a-secret'
fork icon1
star icon3
watch icon3

+ 3 other calls in file

39
40
41
42
43
44
45
46
47
48
* token types are "literal" (true, false, null), "number", "string", and "boolean" (literal with extra
* checks).  JSON-hinted property values are just fed directly to the JSON parser.  Values that cause
* parsing errors (both in the lexer and JSON parser) are skipped with an error message.
* Examples:
*
*     passport.use(new ButtercupStrategy({
*       filename: "/some/file/path/file.bcup,
*       masterPassword: "myMasterPassword!",
*       usernameField: "app_username",
*       passwordField: "app_password",
fork icon0
star icon0
watch icon1

+ 3 other calls in file

24
25
26
27
28
29
30
31
32
33
*   - `passwordField`  field name where the password is found, defaults to _password_
*   - `passReqToCallback`  when `true`, `req` is the first argument to the verify callback (default: `false`)
*
* Examples:
*
*     passport.use(new LocalStrategy(
*       function(username, password, done) {
*         User.findOne({ username: username, password: password }, function (err, user) {
*           done(err, user);
*         });
fork icon0
star icon0
watch icon0

12
13
14
15
16
17
18
19
20
21
*   - `signed` Are the cookie signed? (defaults to false)
*   - `passReqToCallback`  when `true`, `req` is the first argument to the verify callback (default: `false`)
*
* Examples:
*
*  passport.use(new CookieStrategy(
*    function(token, done) {
*      User.findByToken({ token: token }, function(err, user) {
*        if (err) { return done(err); }
*        if (!user) { return done(null, false); }
fork icon0
star icon0
watch icon0