Skip to content
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

Master #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,11 @@ authenticate requests.
For example, as route middleware in an [Express](http://expressjs.com/)
application:

app.get('/auth/sharepoint',
passport.authenticate('sharepoint'),
function(req, res){
// The request will be redirected to SharePoint for authentication, so
// this function will not be called.
});

app.get('/auth/sharepoint/callback',
app.post('/auth/sharepoint',
passport.authenticate('sharepoint', { failureRedirect: '/login' }),
function(req, res) {
// Successful authentication, redirect home.
res.redirect('/');
function (req, res) {
// Successful authentication, redirect home.
res.redirect('/');
});

## Credits
Expand Down
2 changes: 1 addition & 1 deletion lib/passport-sharepoint/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Strategy.prototype.authenticate = function(req, options) {
var spappId = this._appId+"@"+splitApptxSender[1];
var appctx = JSON.parse(token.appctx);
var tokenServiceUri = url.parse(appctx.SecurityTokenServiceUri);
var tokenURL = tokenServiceUri.protocol+'//'+tokenServiceUri.host+'/'+splitApptxSender[1]+tokenServiceUri.path;
var tokenURL = tokenServiceUri.href; // tokenServiceUri.protocol + '//' + tokenServiceUri.host + '/' + splitApptxSender[1] + tokenServiceUri.path;

this._oauth2 = new OAuth2(spappId, this._appSecret, '', authorizationURL, tokenURL);
this._oauth2.getOAuthAccessToken(
Expand Down