Class: Strategy

Strategy(maybeOptions, maybeVerify)

new Strategy(maybeOptions, maybeVerify)

Creates an instance of `Strategy`. The Typetalk authentication strategy authenticates requests by delegating to Typetalk using the OAuth 2.0 protocol. Options: - `clientID` your Typetalk application's client ID - `clientSecret` your Typetalk application's client secret - `callbackURL` URL to which Typetalk will redirect the user after granting authorization - `scope` Permission scopes Examples: passport.use(new TypetalkStrategy({ clientID: '123-456-789' clientSecret: 'shhh-its-a-secret' callbackURL: 'https://www.example.net/auth/typetalk/callback', scope: ['my', 'topic.read'] }, function(accessToken, refreshToken, profile, cb) { User.findOrCreate(..., function (err, user) { cb(err, user); } ));
Parameters:
Name Type Description
maybeOptions object
maybeVerify function
Source:

Methods

(protected) authenticate(req, options)

Authenticate request by delegating to Typetalk using OAuth 2.0.
Parameters:
Name Type Description
req object The request to authenticate.
options object
Source:

(protected) userProfile(accessToken, done)

Retrieve user profile from Typetalk. This function constructs a normalized profile, with the following properties: - `provider` always set to `typetalk` - `id` the user's Typetalk ID
Parameters:
Name Type Description
accessToken string
done function
Source: