Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Make URLs configurable #1

Merged
merged 1 commit into from

2 participants

@mde

People are wanting to use Geddy's Passport integration with Yammer's staging instance, which has a different host name from www.yammer.com. This pull-request allows devs to override all the URLs for Yammer auth, including the one for retrieving profile-data, which was not configurable.

@jaredhanson jaredhanson merged commit ef61338 into jaredhanson:master
@jaredhanson
Owner

Thanks! Merged and pushed to npm as passport-yammer v0.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 15, 2012
  1. Allow all URLs to be configurable

    mde authored
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/passport-yammer/strategy.js
View
3  lib/passport-yammer/strategy.js
@@ -47,6 +47,7 @@ function Strategy(options, verify) {
OAuth2Strategy.call(this, options, verify);
this.name = 'yammer';
+ this.userProfileURL = options.userProfileURL || 'https://www.yammer.com/api/v1/users/current.json';
// Despite claiming to support the OAuth 2.0 specification, Yammer's
// implementation does anything but. Yammer's token endpoint returns a
@@ -98,7 +99,7 @@ util.inherits(Strategy, OAuth2Strategy);
* @api protected
*/
Strategy.prototype.userProfile = function(accessToken, done) {
- this._oauth2.get('https://www.yammer.com/api/v1/users/current.json', accessToken, function (err, body, res) {
+ this._oauth2.get(this.userProfileURL, accessToken, function (err, body, res) {
if (err) { return done(err); }
try {
Something went wrong with that request. Please try again.