I have to use SiteMinder SSO on the top of my angular application. When user hit given url then route to siteMinder login page. Once login is successfully then I have to take care for all the routes, header and session. I didn't find any relevant resource for anguarjs. Could anyone please help me on this? Do I need to write rest api for this? or there is any magic provided by siteMinder which I can use directly.
@app.route("/", methods =["GET"])
@app.route("/<bucket_name>", methods =["GET"])
def auth(bucket_name=None):
headers = request.headers
hdr = dict(headers)
hdr['bucket'] = bucket_name
return jsonify(hdr)
This python script where request.headers simply gives me whole sso header response (like user name, session, cookie and many more) if I am login and my url is register with sso. That means I am already getting authentication header before calling any rest api and it's binding automatically in my every rest api request right? How can I grab that in anguarjs script?
SiteMinder says SM http header can be accessed through Web Application:
Now questions:
Where is good place to access it: client or server side?
If from client side then how?
If server side then do I need to create separate rest api for this?
If in server side then is it okay if I access before my angular app started like this and inject as constant?
function fetchData() {
var initInjector = angular.injector(["ng"]);
var $http = initInjector.get("$http");
return $http.get(env.authHeader).then(function(response) {
flexapp.constant("authHeader", response.data);
console.log(response);
}, function(errorResponse) {
// Handle error case
});
}
- How do I take care of session?