I've multiple users which I want to configure into spring-boot's `UserDetailsService` for basic authentication.

`User` has a additional field `id` tagged with it.

```
import org.springframework.security.core.userdetails.UserDetails;

public class User implements UserDetails {
    private final String username;
    private final String password;
    private final String id;

    private static final String ROLE_USER = "ROLE_USER";

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        SimpleGrantedAuthority simpleGrantedAuthority = new SimpleGrantedAuthority(ROLE_USER);
        return Stream.of(simpleGrantedAuthority).collect(Collectors.toList());
    }

    // Getter & setter
}

```

Properties yml looks like:

```
basic-auth:
    oliver:
        password: twist
        id: 1
    ruskin:
        password: bond
        id: 2
    mark:
        password: twain
        id: 3

```

In `UserDetailsService`, I'm not sure how to configure users using application properties dynamically.

```
public class UserService implements UserDetailsService {

    @Override
    public UserDetails loadUserByUsername(String username) {

        String encodedPassword = passwordEncoder.encode( // How to fetch password );

        String id = // How to fetch id

        return new User(username, encodedPassword, id);
    }
}

```