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