Search in sources :

Example 1 with User

use of com.example.spring.authorizationserver.user.User in project custom-spring-authorization-server by andifalk.

the class AuthorizationServerUserDetailsService method initUsers.

@PostConstruct
public void initUsers() {
    Set<String> bWayneRoles = new HashSet<>();
    bWayneRoles.add("USER");
    User bWayne = new User(UUID.fromString(WAYNE_ID), "bwayne", passwordEncoder.encode("wayne"), "Bruce", "Wayne", "bruce.wayne@example.com", bWayneRoles);
    Set<String> cKentRoles = new HashSet<>();
    cKentRoles.add("USER");
    User cKent = new User(UUID.fromString(KENT_ID), "ckent", passwordEncoder.encode("kent"), "Clark", "Kent", "clark.kent@example.com", cKentRoles);
    Set<String> pParkerRoles = new HashSet<>();
    pParkerRoles.add("USER");
    pParkerRoles.add("ADMIN");
    User pParker = new User(UUID.fromString(PARKER_ID), "pparker", passwordEncoder.encode("parker"), "Peter", "Parker", "peter.parker@example.com", pParkerRoles);
    users.put("bwayne", bWayne);
    users.put("ckent", cKent);
    users.put("pparker", pParker);
    LOGGER.info("Initialized users {}, {} and {}", bWayne, cKent, pParker);
}
Also used : User(com.example.spring.authorizationserver.user.User) PostConstruct(javax.annotation.PostConstruct)

Aggregations

User (com.example.spring.authorizationserver.user.User)1 PostConstruct (javax.annotation.PostConstruct)1