Add basic auth spring security configuration.

This commit is contained in:
Florian THIERRY
2023-11-28 15:17:46 +01:00
parent 025197525c
commit 914785a29b
11 changed files with 191 additions and 10 deletions

View File

@@ -11,9 +11,9 @@ import org.springframework.stereotype.Component;
@Component
public class UserInMemoryAdapter implements UserPort {
private static final List<User> users = List.of(
new User(UUID.fromString("c1a0805f-c618-47dc-bae7-bee70503644e"), "password"),
new User(UUID.fromString("4eff194d-dd8e-463e-974f-034bfd509f84"), "password"),
new User(UUID.fromString("c78d7d7c-0386-415d-86dc-98a470591e07"), "password")
new User(UUID.fromString("c1a0805f-c618-47dc-bae7-bee70503644e"), "$2a$10$WPuLOKpvaQnMotNo5ijPwegBPwmMF1C04XkTNCBpeBFo4r2YJWy.2"),
new User(UUID.fromString("4eff194d-dd8e-463e-974f-034bfd509f84"), "$2a$10$WPuLOKpvaQnMotNo5ijPwegBPwmMF1C04XkTNCBpeBFo4r2YJWy.2"),
new User(UUID.fromString("c78d7d7c-0386-415d-86dc-98a470591e07"), "$2a$10$WPuLOKpvaQnMotNo5ijPwegBPwmMF1C04XkTNCBpeBFo4r2YJWy.2")
);
@Override
@@ -22,4 +22,9 @@ public class UserInMemoryAdapter implements UserPort {
.filter(user -> userId.equals(user.id()))
.findFirst();
}
@Override
public List<User> findAll() {
return users;
}
}