Okay, I have an idea.
But I need the login-information (username, password, enable) after the action: /j_spring_security_check
Code:
<h:form id="formLoginEingabe" action="/j_spring_security_check" method="post">
<h:panelGrid id="loginGrid" columns="3">
<h:outputLabel value="RACF:"/>
<h:inputText id="j_username" size="30" styleClass="inputText"/>
<h:outputLabel value="Password:"/>
<h:inputSecret id="j_password" size="30" styleClass="inputText"/>
<h:commandButton action="#{auth.startpage}" value="Login"/>
</h:panelGrid>
</h:form>
Here my function startpage():
The red words are the issues.
I need the UserDetails in this function.
How can I get this information????
Code:
public String startpage() {
Map<String, Object> sessionMap = FacesContext.getCurrentInstance().getExternalContext().getSessionMap();
us.getUsername();
try{
ExternalContext ext=FacesContext.getCurrentInstance().getExternalContext();
findUser = (User) ext.getSessionMap().get(AuthMgdBean.USER_LOGIN);
// Admin
if(findUser.getRole().equals(Constants.ROLE_ADMIN)){
sessionMap.put(ADMIN, findUser);
newsBean.findNews();
vvBean.reporting();
return "/admin/index";
}
}