Extract Authentication Docs

Issue gh-8005
This commit is contained in:
Rob Winch 2020-02-20 14:54:24 -06:00
parent 49fb6734dc
commit 1965446d6d
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,18 @@
[[servlet-authentication-authentication]]
= Authentication
The {security-api-url}org/springframework/security/core/Authentication.html[`Authentication`] serves two main purposes within Spring Security:
* An input to `AuthenticationManager` to provide the credentials a user has provided to authenticate.
When used in this scenario, `isAuthenticated()` returns `false`.
* Represents the currently authenticated user.
The current `Authentication` can be obtained from the <<servlet-authentication-securitycontext>>.
The `Authentication` contains:
* `principal` - identifies the user.
When authenticating with a username/password this is often an instance of `UserDetails`.
* `credentials` - Often a password.
In many cases this will be cleared after the user is authenticated to ensure it is not leaked.
* `authorities` - the <<servlet-authentication-granted-authority,``GrantedAuthority``s>> are high level permissions the user is granted.
A few examples are roles or scopes.

View File

@ -6,7 +6,7 @@
[[authz-authorities]]
== Authorities
As we saw in the <<tech-granted-authority,technical overview>>, all `Authentication` implementations store a list of `GrantedAuthority` objects.
<<servlet-authentication-authentication,`Authentication`>>, discusses how all `Authentication` implementations store a list of `GrantedAuthority` objects.
These represent the authorities that have been granted to the principal.
the `GrantedAuthority` objects are inserted into the `Authentication` object by the `AuthenticationManager` and are later read by `AccessDecisionManager` s when making authorization decisions.