File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
java/org/springframework/security/config/http
kotlin/org/springframework/security/config/web/servlet/oauth2/resourceserver Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -822,19 +822,19 @@ public String customKey() {
822
822
@ RestController
823
823
static class AuthenticationController {
824
824
@ GetMapping ("/password" )
825
- public String password (@ AuthenticationPrincipal Authentication authentication ) {
825
+ public String password (Authentication authentication ) {
826
826
return (String ) authentication .getCredentials ();
827
827
}
828
828
829
829
@ GetMapping ("/roles" )
830
- public String roles (@ AuthenticationPrincipal Authentication authentication ) {
830
+ public String roles (Authentication authentication ) {
831
831
return authentication .getAuthorities ().stream ()
832
832
.map (GrantedAuthority ::getAuthority )
833
833
.collect (Collectors .joining ("," ));
834
834
}
835
835
836
836
@ GetMapping ("/details" )
837
- public String details (@ AuthenticationPrincipal Authentication authentication ) {
837
+ public String details (Authentication authentication ) {
838
838
return authentication .getDetails ().getClass ().getName ();
839
839
}
840
840
}
Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ class OpaqueTokenDslTests {
176
176
@RestController
177
177
class AuthenticationController {
178
178
@GetMapping(" /authenticated" )
179
- fun authenticated (@AuthenticationPrincipal authentication : Authentication ): String {
179
+ fun authenticated (authentication : Authentication ): String {
180
180
return authentication.name
181
181
}
182
182
}
You can’t perform that action at this time.
0 commit comments