Skip to content

Commit

Permalink
Making some changes to not pass the Authorization header when it is c…
Browse files Browse the repository at this point in the history
…onfigured for SSO authentication.
  • Loading branch information
longdogz committed Jun 14, 2017
1 parent 3b3039c commit 98431be
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
4 changes: 3 additions & 1 deletion modules/ui/app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ angular.module('wasabi', [
if (ConfigFactory.authnType() === 'sso') {
window.location = ConfigFactory.noAuthRedirect();
}
$state.go('signin');
else {
$state.go('signin');
}
};

$rootScope.keepAlive = function() {
Expand Down
21 changes: 12 additions & 9 deletions modules/ui/app/scripts/services/HttpInterceptor.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ angular.module('wasabi.services').factory('HttpInterceptor', ['$rootScope', '$q'

if (Session.accessToken && !/\/savefeedback/.test(config.url)) {
// http://stackoverflow.com/questions/7802116/custom-http-authorization-header
config.headers.Authorization = Session.tokenType + ' ' + Session.accessToken;
if (ConfigFactory.authnType() !== 'sso') {
// Since in this case, the Authorization header is provided by the SSO
config.headers.Authorization = Session.tokenType + ' ' + Session.accessToken;

if (!$rootScope.isSetTimeout || (config.url && config.url.substring(0,4) === 'http')) {
// Start the timer for logging the user out automatically.
if ($rootScope.isSetTimeout) {
clearTimeouts();
}
if (!/\/logout$/.test(config.url)) {
$rootScope.isSetTimeout = $timeout(doTimeout, ConfigFactory.loginTimeoutWarningTime);
$rootScope.isLogoutTimeout = $timeout(doForcedLogout, ConfigFactory.loginTimeoutTime);
if (!$rootScope.isSetTimeout || (config.url && config.url.substring(0,4) === 'http')) {
// Start the timer for logging the user out automatically.
if ($rootScope.isSetTimeout) {
clearTimeouts();
}
if (!/\/logout$/.test(config.url)) {
$rootScope.isSetTimeout = $timeout(doTimeout, ConfigFactory.loginTimeoutWarningTime);
$rootScope.isLogoutTimeout = $timeout(doForcedLogout, ConfigFactory.loginTimeoutTime);
}
}
}
}
Expand Down

0 comments on commit 98431be

Please sign in to comment.