I have:
- A Java EE Web Application project in Netbeans 7.2. Shiro-Web is installed and working great with standard settings in the INI file: users are automatically redirected to the standard login.jsp page, where they can log in without problems.
I want:
- To create a custom login page login.xhtml, annotated with PrimeFaces tags, where the login process is handled by a backing bean.
I need:
To understand the steps that need to be performed in this login bean. Currently, I have a working Realm implemented, and I am able to authenticate a user:
UsernamePasswordToken currentUserToken = new UsernamePasswordToken(userEmail, userPassword); try { SecurityUtils.getSubject().login(currentUserToken); } catch(UnknownAccountException uae) { // TODO: Notify user that no such account exists } catch(IncorrectCredentialsException ice) { // TODO: Notify user that login attempt failed due to bad credentials } // TODO: How to set up user session an everything else, if login succeeded?However, what additional steps do I need to take to make sure the users session (and everything else) is also properly set? I want to end up in the same state, as if I used the standard Shiro login feature (Session set up, appropriate settings set etc).
Eventually, to understand how to configure Shiro NOT to filter out the JSF tags in the login page. Currently, the rendering defaults to standard HTML, and all the graphic goodies disappear.