Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package demo.domain.service; import demo.domain.model.Account; import java.util.Collection; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.User; /** * * @author Kanekos */ public class MyUserDetails extends User { private static final long serialVersionUID = -8019854384625172222L; private final Account account; public MyUserDetails(Account account, Collection<GrantedAuthority> authorities) { super(account.getUserId(), account.getPassword(), !account.isDeleted(), true, true, true, authorities); this.account = account; } public Account getAccount() { return account; } }