Name: passport-bnet
Owner: Blizzard Entertainment
Description: Passport Strategy for Battle.net Login
Created: 2014-08-21 15:38:50.0
Updated: 2018-01-09 12:22:24.0
Pushed: 2017-08-15 21:19:21.0
Homepage: null
Size: 17
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This is an Node.js Passport strategy for authenticating to Blizzard's Battle.net OAuth service. In order to use it you need to register an application at the Battle.net Developer Portal
$ npm install passport-bnet
BnetStrategy = require('passport-bnet').Strategy;
BNET_ID = process.env.BNET_ID
BNET_SECRET = process.env.BNET_SECRET
se the BnetStrategy within Passport.
port.use(new BnetStrategy({
clientID: BNET_ID,
clientSecret: BNET_SECRET,
callbackURL: "https://localhost:3000/auth/bnet/callback",
region: "us"
unction(accessToken, refreshToken, profile, done) {
return done(null, profile);
get('/auth/bnet',
passport.authenticate('bnet'));
get('/auth/bnet/callback',
passport.authenticate('bnet', { failureRedirect: '/' }),
function(req, res){
res.redirect('/');
});