Blizzard/passport-bnet

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Passport Bnet

NPM version

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

Installation
$ npm install passport-bnet
Usage
Configure
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);

Authenticate Requests
get('/auth/bnet',
passport.authenticate('bnet'));

get('/auth/bnet/callback',
passport.authenticate('bnet', { failureRedirect: '/' }),
function(req, res){
    res.redirect('/');
});
License

The MIT License


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.