-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
APAC Region Doesn't Appear to Work #19
Comments
Issue logged on blizzard dev forums: Update, created a more minimal code example const app = require('express')(); // <------- NPM install
const passport = require('passport'); // <------- NPM install
const BnetStrategy = require('passport-bnet').Strategy; // <------- NPM install
const fs = require('fs');
const https = require('https');
const port = 3000;
const BNET_ID = 'myID'; // <------- Change me
const BNET_SECRET = 'mySecret'; // <------- Change me
const region = 'apac'; // <------- us works, apac doesn't
const privateKey = fs.readFileSync('../certs/key.pem', 'utf8'); // <------- Change me
const certificate = fs.readFileSync('../certs/cert.pem', 'utf8'); // <------- Change me
const credentials = {key: privateKey, cert: certificate};
app.use(passport.initialize());
// Use the BnetStrategy within Passport.
passport.use(new BnetStrategy({
clientID: BNET_ID,
clientSecret: BNET_SECRET,
callbackURL: `https://localhost:${port}/auth/bnet/callback`,
region: region
}, function(accessToken, refreshToken, profile, done) {
return done(null, profile);
}));
app.get('/auth/bnet',
passport.authenticate('bnet'));
app.get('/auth/bnet/callback',
passport.authenticate('bnet', {
failureRedirect: '/?successful=false',
session: false
}),
function(req, res){
console.log('SUCCESSFUL LOGIN');
res.redirect('/?successful=true');
});
https.createServer(credentials, app).listen(port, () => {
console.log(`Server listening on port: ${port}`);
}); |
The problemFinally found some time to look into this. The problem is when you retrieve the profile: this._profileUrl = options.userURL || 'https://' + getMasheryHost(options.region) + '/account/user' This does not work with the The workaroundThe workaround is clearly to pass in a valid url with SolutionsDocumentation: Document that this module does not work out of the box with the Map apac to a region supported by the community API: I'd open a PR for this myself but my guess is that someone at Blizzard needs to decide the best course of action for this. |
I get the error at the same point, it just hangs then after a minute I get |
Turns out if I use |
I'll include some code although, it's much more complex than what is necessary to reproduce this issue. (The code is from my application)
Essentially I set up a strategy to handle each of the login regions.
us
andeu
work fine,apac
doesn't appear to work. Not sure if this is an issue with this library since thegetHost()
method that resolves the regional OAuth endpoint is quite simple...If this is the wrong place to open this issue, please let me know.
and the error:
The text was updated successfully, but these errors were encountered: