Skip to content

Commit 42a2309

Browse files
committed
Update docs on Principal controller method arguments
Closes gh-26791
1 parent d25ae4b commit 42a2309

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/docs/asciidoc/web/webmvc.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,6 +2003,12 @@ and others) and is equivalent to `required=false`.
20032003
| `java.security.Principal`
20042004
| Currently authenticated user -- possibly a specific `Principal` implementation class if known.
20052005

2006+
Note that this argument is not resolved eagerly, if it is annotated in order to allow a custom resolver to resolve it
2007+
before falling back on default resolution resolution via `HttpServletRequest#getUserPrincipal`.
2008+
For example, the Spring Security `Authentication` implements `Principal` and would be injected as such via
2009+
`HttpServletRequest#getUserPrincipal`, unless it is also annotated with `@AuthenticationPrincipal` in which case it
2010+
is resolved by a custom Spring Security resolver through `Authentication#getPrincipal`.
2011+
20062012
| `HttpMethod`
20072013
| The HTTP method of the request.
20082014

0 commit comments

Comments
 (0)