My application uses siteminder authentication. The siteminder will append user details such as username, userid etc to the http request header and redirect to my application. I need to store these user details from the header in a bean and access it in my business logic. Have a few questions.
What kind of scope is recommended for the UserDetailsBean ? Session or request ?
Where can I intercept the request and extract the user information from the header ? Can I do it inside a filter ? Or can I do it inside my UserDetailsBean (session bean)constructor ?
Can I do something like
public UserBean() {
FacesContext context = FacesContext.getCurrentInstance();
Map<String, String> requestHeaderMap = context.getExternalContext().getRequestHeaderMap();
String userId = requestHeaderMap.get("sm_userID");
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
logger.info("[Bean - User is] "+userId);
this.userId = userId;
}
}
And access the UserBean.getUserId throughout my application ?