Advertisement
Guest User

Untitled

a guest
Mar 16th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. @ManagedBean
  2. @SessionScoped
  3. public class loginBean() {
  4. private String username = null;
  5. private String password = null;
  6. private UUID uuid = null;
  7. private boolean rememberMe = false;
  8.  
  9. public void doLogin() {
  10. checkCookies(); // this method sets the property values after checking if
  11. // username & uuid match the ones saved previously
  12. if (username != null && uuid != null && rememberMe) {
  13. // authenticate automatically. Here I don't know how to proceed, because
  14. // I don't have the password, unless I have saved it in the application's db,
  15. // duplicating it because it's already in LDAP server.
  16. } else {
  17. httpServletRequest.login(username, password); // this uses LDAP behind JAAS
  18. createCookies(); // this method also saves username & uuid in the app's db
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement