passport.use(new Strategy({ clientID: client.appInfo.id, clientSecret: client.config.dashboard.oauthSecret, callbackURL: client.config.dashboard.callbackURL, scope: ["identify", "guilds", "guilds.join"] }, (accessToken, refreshToken, profile, done) => { process.nextTick(() => done(null, profile)); }));
// Setup passport and express-session passport.use(new discordStrategy({ clientID: auth.discord.clientID, clientSecret: auth.discord.clientSecret, callbackURL: `${configJS.hostingURL}login/callback`, scope: discordOAuthScopes, }, (accessToken, refreshToken, profile, done) => { process.nextTick(() => done(null, profile)); }));
passport.use(new GitHubStrategy({ clientID: config.get('GITHUB_CLIENT_ID'), clientSecret: config.get('GITHUB_CLIENT_SECRET'), callbackURL: config.get('GITHUB_CALLBACK') }, function(accessToken, refreshToken, profile, done) { return done(null, profile); }) );
passport.use(new GitHubStrategy({ clientID: app.config.oauth.github.key, clientSecret: app.config.oauth.github.secret, customHeaders: { "User-Agent": app.config.projectName } }, function(accessToken, refreshToken, profile, done) { done(null, false, { accessToken: accessToken, refreshToken: refreshToken, profile: profile }); } ));
passport.use(new GithubStrategy({ clientID: "51b724f62c93aa05a45c", clientSecret: "b9ca4eee3f959fc49d2b11625f84998678423cde", callbackURL: "http://localhost:30000/auth/github/callback" }, function(accessToken, refreshToken, profile, done) { return done(null, profile); } ));
options.customHeaders = options.customHeaders || {}; OAuth2Strategy.call(this, options, verify) this.name = 'microsoft'
passport.use(new GitHubStrategy({ clientID: process.env.GITHUB_CLIENT_ID, clientSecret: process.env.GITHUB_CLIENT_SECRET, callbackURL: "http://localhost:3000/api/auth/github/callback" }, (accessToken, refreshToken, profile, done) => { db.User.findOrCreate({ where: { githubId: profile.id, username: profile.username, email: profile.emails[0].value }}) .spread((user, created) => { done(null, user) }) .catch((err) => { done(new Error('Internal Server Error')) }) } ));
passport.use(new GitHubStrategy({ clientID: process.env.GITHUB_ID || "", clientSecret: process.env.GITHUB_SECRET || "", callbackURL: "http://127.0.0.1:5000/auth/github/callback" }, (accessToken, refreshToken, profile, cb) => { User.findOne({githubId: profile.id}).then((rUser)=>{ if(!rUser){ console.log(profile); user = new User({ username: profile.username, githubId: profile.id }); user.save((err)=>{ if(err) console.log(err); cb(err,user); }); }else{ return cb(null,rUser); } }).catch((err)=>{ cb(err); }); } ));
passport.use( new Strategy( { clientID: client.user.id, clientSecret: process.env.CLIENT_SECRET, callbackURL: "http://localhost:3000/login", scope: scopes }, async (accessToken, refreshToken, profile, done) => { process.nextTick(async () => { return done(null, profile); }); } ) );
passport.use(new GitHubStrategy({ clientID: process.env.GITHUB_CLIENT_ID, clientSecret: process.env.GITHUB_CLIENT_SECRET, callbackURL: '/auth/github/callback' }, (accessToken, refreshToken, profile, done) => { AuthService.resolveUser({ github_id: profile.id, name: profile.displayName.split(' ')[0], last_name: profile.displayName.split(' ').slice(1).join(' '), email: profile.emails[0].value }, (err, user, info) => { if (err) { return done(err); } if (user) { user.info = _getThirdPartyInfo(profile); } done(null, user, info); }); }));
passport.use(new GitHubStrategy(config.GITHUB_OAUTH, function (accessToken, refreshToken, profile, done) { done(null, profile) }))
passport.use(new GitHubStrategy({ clientID: process.env.GITHUB_CLIENT_ID, clientSecret: process.env.GITHUB_SECRET_ID, callbackURL: "https://gitmessenger.herokuapp.com/auth/github/callback", passReqToCallback : true, }, function(req, accessToken, refreshToken, profile, done) { var user = new User( profile.displayName, profile.username, profile['_json'].avatar_url, profile["_json"].html_url, profile["_json"].bio ); firebase.registerUser(user).catch(err => console.error); // If you don't need .then() you can just add an .catch return done(null,user) } ));
passport.use(new GitHubStrategy({ clientID: app.config.oauth.github.key, clientSecret: app.config.oauth.github.secret, customHeaders: { "User-Agent": app.config.projectName } }, function(accessToken, refreshToken, profile, done) { done(null, false, { accessToken: accessToken, refreshToken: refreshToken, profile: profile }); } ));
// This defines the **Passport** OAuth2 data. A few things are necessary here. // clientID = The bot's client ID, from the app page. Please note that // older bots have BOTH a Client ID and a Bot ID. Use the Client one. // clientSecret: The secret code at the top of the app page that you have to // click to reveal. Yes that one we told you you'd never use. // callbackURL: The URL that will be called after the login. This URL must be // available from your PC for now, but must be available publicly if you're // ever to use this dashboard in an actual bot of your own. // scope: The data scopes we need for data. identify and guilds are sufficient // for most purposes. You might have to add more if you want access to more // stuff from the user. See: https://discordapp.com/developers/docs/topics/oauth2 // See config.js.example to set these up. passport.use(new Strategy({ clientID: client.appInfo.id, clientSecret: client.config.dashboard.oauthSecret, callbackURL: client.config.dashboard.callbackURL, scope: ["identify", "guilds"] }, (accessToken, refreshToken, profile, done) => { process.nextTick(() => done(null, profile)); }));