@Factory("loginContext")
@Begin(join = true)
public LoginContext initLoginContext() {
if (loginContext == null) {
loginContext = new LoginContext();
}
loginContext.setLanguageCode(LocaleSelector.instance().getLanguage());
checkEnvironment();
Map<String,String> requestParams = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
String prodCode=requestParams.get("prodCode");
String token=requestParams.get("token");
//token validation
if (token.equals("admin")) {
System.out.println("admin page");
} else if (token.equals("user")) {
System.out.println("user page");
} else {
return loginContext;
}
}
here i will be getting user credentials in token(JWE string) and then some validation of on user is done(till here code is fine and i am clear how to do this). later on on the basis of user privilege, i will navigate directly to related page for user(instead of loading the login page related to controller)
I am stuck here, Pls suggest something