Skip to content

Commit

Permalink
Merge pull request #8 from rachaelsingleton/master
Browse files Browse the repository at this point in the history
Prompt option
  • Loading branch information
seanfisher committed Apr 14, 2022
2 parents 637aa94 + 9478a17 commit e42b76d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/strategy.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ function MicrosoftStrategy(options, verify) {
options.tokenURL = options.tokenURL || 'https://login.microsoftonline.com/common/oauth2/v2.0/token';
options.scopeSeparator = options.scopeSeparator || ' ';
options.customHeaders = options.customHeaders || {};
//options.prompt = options.prompt || 'select_account';

OAuth2Strategy.call(this, options, verify)
this.name = 'microsoft'
Expand All @@ -74,6 +75,22 @@ util.inherits(MicrosoftStrategy, OAuth2Strategy)
* @api protected
*/

MicrosoftStrategy.prototype.authorizationParams = function(options) {
var params = {};

['locale', 'display'].forEach(function(name) {
if (options[name]) {
params[name] = options[name]
}
});

if (options.prompt) {
params['prompt'] = options.prompt;
}

return params;
};

MicrosoftStrategy.prototype.userProfile = function (accessToken, done) {

this._oauth2.useAuthorizationHeaderforGET(true);
Expand Down

0 comments on commit e42b76d

Please sign in to comment.