Skip to content

Commit

Permalink
add flag to allow for disabling loading of user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
brockallen committed Dec 13, 2014
1 parent ce17963 commit 45d44a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions source/OAuthJS/JsImplicitOAuthLibraryDemo/callback.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
var config = {
client_id: "implicitclient",
authority: "https://localhost:44333/core",
//load_user_profile : false
};
var mgr = new TokenManager(config);

Expand Down
6 changes: 5 additions & 1 deletion source/OAuthJS/JsImplicitOAuthLibraryDemo/oidc/oidc.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion source/OAuthJS/JsImplicitOAuthLibraryDemo/oidc/oidcclient.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ var requestDataKey = "OidcClient.requestDataKey";
function OidcClient(settings) {
this._settings = settings || {};

if (typeof this._settings.load_user_profile === 'undefined') {
this._settings.load_user_profile = true;
}

if (this._settings.authority && this._settings.authority.indexOf('.well-known/openid-configuration') < 0) {
if (this._settings.authority[this._settings.authority.length - 1] != '/') {
this._settings.authority += '/';
Expand Down Expand Up @@ -346,7 +350,7 @@ OidcClient.prototype.validateIdTokenAsync = function (jwt, nonce, access_token)
return error("Token expired");
}

if (access_token){
if (access_token && settings.load_user_profile) {
// if we have an access token, then call user info endpoint
return client.loadUserProfile(access_token, id_token).then(function (id_token) {
return id_token;
Expand Down

0 comments on commit 45d44a3

Please sign in to comment.