Announcement Announcement Module
No announcement yet.
Having my own User for the security context, the Roo way Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Having my own User for the security context, the Roo way

    Hi guys,

    In my application I've got a Person that I want to use for authentication. As mentioned here I extended my Person class to inherit from . That gave me a compile error since I had to implement the constructor:

    	public Person(String username, String password, boolean enabled,
    			boolean accountNonExpired, boolean credentialsNonExpired,
    			boolean accountNonLocked, Collection<GrantedAuthority> authorities) {
    		super(username, password, enabled, accountNonExpired, credentialsNonExpired,
    				accountNonLocked, authorities);
    No problem there, except that when I compile I get

    error at super();
    /Users/niklas/Documents/Eclipse/myProject/src/main/java/dk/mycompany/myProject/data/entities/Person_Roo_Entity.aj:32:0::0 The constructor User() is undefined
    So it tries to make a constructor that is empty, which is not valid for User. What would be the correct way to handle this?



  • #2
    Instead of extending User I suggest simply implement the UserDetails interface and implement as you like. That is what I tend to do, but I tend also to have my own UserDetailsService implementation with that.


    • #3
      No I don't think this is the problem. I've tried ever since Sunday night, but it just doesn't work.

      ------------------------ |
      Last edited by leo76; Jan 17th, 2014, 02:07 AM.