In Java, we can get http request header from HttpServletRequest.
Enumeration headerNames = request.getHeaderNames(); // request is HttpServletRequest
For our application we are trying to integrate SiteMinder with angularjs. In order to get user attributes after successful login, we need to extract data from request header. We are trying to construct a URL which will be the target and on successful authentication SiteMinder will redirect user to this URL. For example : the URL will be like this http://example.com/appContextRoot/testSM (where testSM is a state of angularjs)
$stateProvider.state('testSM', {
parent: '...',
url: '/testSM',
data: {
authorities: []
},
views: {
'content@': {
templateUrl: '',
controller: 'TestSMController',
controllerAs: 'vm'
}
},
Is there any way to get the attributes from request header as done in Java in angularjs after SiteMinder redirect user to this URL?
No. Angular is Javascript - it runs in the browser. The request headers are injected between the SiteMinder web agent and you server-side application. They are not sent to the browser. What you need to do is make you server-side app (e.g. REST web services) expose the attributes so they can be queried by the browser. However do so with extreme caution - many headers provide sensitive PII or infrastructure detail information and are not meant to be exposed to the browser side. If you stick to simple values like username, email address, first & last name etc. then you should be OK.