parent
3d9e5d4bc3
commit
63cd32682c
|
@ -802,18 +802,18 @@ public class MiscHttpConfigTests {
|
|||
static class AuthenticationController {
|
||||
|
||||
@GetMapping("/password")
|
||||
String password(@AuthenticationPrincipal Authentication authentication) {
|
||||
String password(Authentication authentication) {
|
||||
return (String) authentication.getCredentials();
|
||||
}
|
||||
|
||||
@GetMapping("/roles")
|
||||
String roles(@AuthenticationPrincipal Authentication authentication) {
|
||||
String roles(Authentication authentication) {
|
||||
return authentication.getAuthorities().stream().map(GrantedAuthority::getAuthority)
|
||||
.collect(Collectors.joining(","));
|
||||
}
|
||||
|
||||
@GetMapping("/details")
|
||||
String details(@AuthenticationPrincipal Authentication authentication) {
|
||||
String details(Authentication authentication) {
|
||||
return authentication.getDetails().getClass().getName();
|
||||
}
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ class OpaqueTokenDslTests {
|
|||
@RestController
|
||||
class AuthenticationController {
|
||||
@GetMapping("/authenticated")
|
||||
fun authenticated(@AuthenticationPrincipal authentication: Authentication): String {
|
||||
fun authenticated(authentication: Authentication): String {
|
||||
return authentication.name
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue