For example this is my VM WARE WEBGATE login page.
After entering Valid Credentials it will Valid Under OAM (oracle access manager) and it will return headers in response.
Now, If the user is valid it will redirect to another page.
But, I can't see the header parameters in response what the WebGate returning
This is my Code:
app.factory('mainHttpInterceptor' ,
function($rootScope, $q, $location) {`enter code here`
console.log("in the authInterceptor------000000");
return{
request:function(config) {
console.log(config.headers);
return config;
},
response: function(response){
/* if (typeof response.headers != null) {
console.log(response.headers);
return response;
} */
console.log('in the hhtp interceptor');
$httpProvider.defaults.headers.common['Access-Control-Allow-Headers']= true;
console.log(response.headers());
console.log(response);
return response;
},
responseError: function(rejection){
console.log('Failed with', rejection.status, 'status');
if( rejection.status ==403){
$location.url('/login');
}
else if( rejection.status ==404){
console.log("nothing is there----------->");
/*$state.go('login');*/
}
return $q.reject(rejection);
}
};
})
app.config(['$httpProvider',function($httpProvider) {
$httpProvider.defaults.withCredentials = true;
/*Access-Control-Allow-Credentials == true;*/
$httpProvider.defaults.headers.common['Access-Control-Allow-Headers'] = true;
$httpProvider.interceptors.push('mainHttpInterceptor');
}]);
What, Should i do to to get those header parameters into my code.