Retrieve user profile from Snapchat.
This function constructs a normalized profile, with the following properties:
provider always set to snapchatid the user's Snapchat IDdisplayName the user's display namebitmoji.avatarId the bitmojiAvatarId for the user on Snapchatbitmoji.avatarUrl the url for rendering the bitmoji avatar for the user on SnapchatGenerated using TypeDoc
Strategyconstructor.The Snapchat authentication strategy authenticates requests by delegating to Snapchat using the OAuth 2.0 protocol.
Applications must supply a
verifycallback which accepts anaccessToken,refreshTokenand service-specificprofile, and then calls thecbcallback supplying auser, which should be set tofalseif the credentials are not valid. If an exception occured,errshould be set.Options:
clientIDyour Snapchat application's App IDclientSecretyour Snapchat application's App SecretcallbackURLURL to which Snapchat will redirect the user after granting authorizationprofileFieldsarray of fields to add to query. Valid fields are 'id', 'displayName', 'bitmoji'.scopearray of scopes. Valid scopes are 'user.display_name' & 'user.bitmoji.avatar'.Examples:
passport.use(new SnapchatStrategy({ clientID: '123-456-789', // process.env.clientID clientSecret: 'shhh-its-a-secret', // process.env.clientSecret callbackURL: 'https://www.example.net/auth/Snapchat/callback', profileFields: ['id', 'displayName', 'bitmoji'], scope: ['user.display_name', 'user.bitmoji.avatar'], }, function(accessToken, refreshToken, profile, cb) { User.findOrCreate(..., function (err, user) { cb(err, user); }); } ));