You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/manual/src/docs/asciidoc/_includes/reactive/oauth2/resource-server.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,7 +121,7 @@ This property can also be supplied directly on the <<webflux-oauth2resourceserve
121
121
[[webflux-oauth2resourceserver-jwt-sansboot]]
122
122
=== Overriding or Replacing Boot Auto Configuration
123
123
124
-
There are two `@Bean`s that Spring Boot generates on Resource Server's behalf.
124
+
There are two ``@Bean``s that Spring Boot generates on Resource Server's behalf.
125
125
126
126
The first is a `SecurityWebFilterChain` that configures the app as a resource server. When including `spring-security-oauth2-jose`, this `SecurityWebFilterChain` looks like:
127
127
@@ -1045,7 +1045,7 @@ fun forFoosEyesOnly(): Mono<String> {
1045
1045
[[webflux-oauth2resourceserver-opaque-sansboot]]
1046
1046
=== Overriding or Replacing Boot Auto Configuration
1047
1047
1048
-
There are two `@Bean`s that Spring Boot generates on Resource Server's behalf.
1048
+
There are two ``@Bean``s that Spring Boot generates on Resource Server's behalf.
1049
1049
1050
1050
The first is a `SecurityWebFilterChain` that configures the app as a resource server.
1051
1051
When use Opaque Token, this `SecurityWebFilterChain` looks like:
Copy file name to clipboardExpand all lines: docs/manual/src/docs/asciidoc/_includes/servlet/authentication/anonymous.adoc
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,8 +26,8 @@ Anonymous authentication support is provided automatically when using the HTTP c
26
26
You don't need to configure the beans described here unless you are using traditional bean configuration.
27
27
28
28
Three classes that together provide the anonymous authentication feature.
29
-
`AnonymousAuthenticationToken` is an implementation of `Authentication`, and stores the `GrantedAuthority`s which apply to the anonymous principal.
30
-
There is a corresponding `AnonymousAuthenticationProvider`, which is chained into the `ProviderManager` so that `AnonymousAuthenticationToken`s are accepted.
29
+
`AnonymousAuthenticationToken` is an implementation of `Authentication`, and stores the ``GrantedAuthority``s which apply to the anonymous principal.
30
+
There is a corresponding `AnonymousAuthenticationProvider`, which is chained into the `ProviderManager` so that ``AnonymousAuthenticationToken``s are accepted.
31
31
Finally, there is an `AnonymousAuthenticationFilter`, which is chained after the normal authentication mechanisms and automatically adds an `AnonymousAuthenticationToken` to the `SecurityContextHolder` if there is no existing `Authentication` held there.
32
32
The definition of the filter and authentication provider appears as follows:
33
33
@@ -91,7 +91,7 @@ For example:
91
91
=== AuthenticationTrustResolver
92
92
Rounding out the anonymous authentication discussion is the `AuthenticationTrustResolver` interface, with its corresponding `AuthenticationTrustResolverImpl` implementation.
93
93
This interface provides an `isAnonymous(Authentication)` method, which allows interested classes to take into account this special type of authentication status.
94
-
The `ExceptionTranslationFilter` uses this interface in processing `AccessDeniedException`s.
94
+
The `ExceptionTranslationFilter` uses this interface in processing ``AccessDeniedException``s.
95
95
If an `AccessDeniedException` is thrown, and the authentication is of an anonymous type, instead of throwing a 403 (forbidden) response, the filter will instead commence the `AuthenticationEntryPoint` so the principal can authenticate properly.
96
96
This is a necessary distinction, otherwise principals would always be deemed "authenticated" and never be given an opportunity to login via form, basic, digest or some other normal authentication mechanism.
Copy file name to clipboardExpand all lines: docs/manual/src/docs/asciidoc/_includes/servlet/authentication/cas.adoc
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ Inside the WAR file you will customise the login and other single sign on pages
23
23
When deploying a CAS 3.4 server, you will also need to specify an `AuthenticationHandler` in the `deployerConfigContext.xml` included with CAS.
24
24
The `AuthenticationHandler` has a simple method that returns a boolean as to whether a given set of Credentials is valid.
25
25
Your `AuthenticationHandler` implementation will need to link into some type of backend authentication repository, such as an LDAP server or database.
26
-
CAS itself includes numerous `AuthenticationHandler`s out of the box to assist with this.
26
+
CAS itself includes numerous ``AuthenticationHandler``s out of the box to assist with this.
27
27
When you download and deploy the server war file, it is set up to successfully authenticate users who enter a password matching their username, which is useful for testing.
28
28
29
29
Apart from the CAS server itself, the other key players are of course the secure web applications deployed throughout your enterprise.
@@ -57,7 +57,7 @@ The processing filter will construct a `UsernamePasswordAuthenticationToken` rep
57
57
The principal will be equal to `CasAuthenticationFilter.CAS_STATEFUL_IDENTIFIER`, whilst the credentials will be the service ticket opaque value.
58
58
This authentication request will then be handed to the configured `AuthenticationManager`.
59
59
* The `AuthenticationManager` implementation will be the `ProviderManager`, which is in turn configured with the `CasAuthenticationProvider`.
60
-
The `CasAuthenticationProvider` only responds to `UsernamePasswordAuthenticationToken`s containing the CAS-specific principal (such as `CasAuthenticationFilter.CAS_STATEFUL_IDENTIFIER`) and `CasAuthenticationToken`s (discussed later).
60
+
The `CasAuthenticationProvider` only responds to ``UsernamePasswordAuthenticationToken``s containing the CAS-specific principal (such as `CasAuthenticationFilter.CAS_STATEFUL_IDENTIFIER`) and ``CasAuthenticationToken``s (discussed later).
61
61
* `CasAuthenticationProvider` will validate the service ticket using a `TicketValidator` implementation.
62
62
This will typically be a `Cas20ServiceTicketValidator` which is one of the classes included in the CAS client library.
63
63
In the event the application needs to validate proxy tickets, the `Cas20ProxyTicketValidator` is used.
Copy file name to clipboardExpand all lines: docs/manual/src/docs/asciidoc/_includes/servlet/authentication/jaas.adoc
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ The `AbstractJaasAuthenticationProvider` has a number of dependencies that can b
16
16
17
17
[[jaas-callbackhandler]]
18
18
==== JAAS CallbackHandler
19
-
Most JAAS `LoginModule`s require a callback of some sort.
19
+
Most JAAS ``LoginModule``s require a callback of some sort.
20
20
These callbacks are usually used to obtain the username and password from the user.
21
21
22
22
In a Spring Security deployment, Spring Security is responsible for this user interaction (via the authentication mechanism).
@@ -26,26 +26,26 @@ Therefore, the JAAS package for Spring Security provides two default callback ha
26
26
Each of these callback handlers implement `JaasAuthenticationCallbackHandler`.
27
27
In most cases these callback handlers can simply be used without understanding the internal mechanics.
28
28
29
-
For those needing full control over the callback behavior, internally `AbstractJaasAuthenticationProvider` wraps these `JaasAuthenticationCallbackHandler`s with an `InternalCallbackHandler`.
29
+
For those needing full control over the callback behavior, internally `AbstractJaasAuthenticationProvider` wraps these ``JaasAuthenticationCallbackHandler``s with an `InternalCallbackHandler`.
30
30
The `InternalCallbackHandler` is the class that actually implements JAAS normal `CallbackHandler` interface.
31
-
Any time that the JAAS `LoginModule` is used, it is passed a list of application context configured `InternalCallbackHandler`s.
32
-
If the `LoginModule` requests a callback against the `InternalCallbackHandler`s, the callback is in-turn passed to the `JaasAuthenticationCallbackHandler`s being wrapped.
31
+
Any time that the JAAS `LoginModule` is used, it is passed a list of application context configured ``InternalCallbackHandler``s.
32
+
If the `LoginModule` requests a callback against the ``InternalCallbackHandler``s, the callback is in-turn passed to the ``JaasAuthenticationCallbackHandler``s being wrapped.
33
33
34
34
35
35
[[jaas-authoritygranter]]
36
36
==== JAAS AuthorityGranter
37
37
JAAS works with principals.
38
38
Even "roles" are represented as principals in JAAS.
39
39
Spring Security, on the other hand, works with `Authentication` objects.
40
-
Each `Authentication` object contains a single principal, and multiple `GrantedAuthority`s.
40
+
Each `Authentication` object contains a single principal, and multiple ``GrantedAuthority``s.
41
41
To facilitate mapping between these different concepts, Spring Security's JAAS package includes an `AuthorityGranter` interface.
42
42
43
-
An `AuthorityGranter` is responsible for inspecting a JAAS principal and returning a set of `String`s, representing the authorities assigned to the principal.
43
+
An `AuthorityGranter` is responsible for inspecting a JAAS principal and returning a set of ``String``s, representing the authorities assigned to the principal.
44
44
For each returned authority string, the `AbstractJaasAuthenticationProvider` creates a `JaasGrantedAuthority` (which implements Spring Security's `GrantedAuthority` interface) containing the authority string and the JAAS principal that the `AuthorityGranter` was passed.
45
45
The `AbstractJaasAuthenticationProvider` obtains the JAAS principals by firstly successfully authenticating the user's credentials using the JAAS `LoginModule`, and then accessing the `LoginContext` it returns.
46
46
A call to `LoginContext.getSubject().getPrincipals()` is made, with each resulting principal passed to each `AuthorityGranter` defined against the `AbstractJaasAuthenticationProvider.setAuthorityGranters(List)` property.
47
47
48
-
Spring Security does not include any production `AuthorityGranter`s given that every JAAS principal has an implementation-specific meaning.
48
+
Spring Security does not include any production ``AuthorityGranter``s given that every JAAS principal has an implementation-specific meaning.
49
49
However, there is a `TestAuthorityGranter` in the unit tests that demonstrates a simple `AuthorityGranter` implementation.
50
50
51
51
@@ -59,7 +59,7 @@ This means that `DefaultJaasAuthenticationProvider` is not bound any particular
59
59
[[jaas-inmemoryconfiguration]]
60
60
==== InMemoryConfiguration
61
61
In order to make it easy to inject a `Configuration` into `DefaultJaasAuthenticationProvider`, a default in-memory implementation named `InMemoryConfiguration` is provided.
62
-
The implementation constructor accepts a `Map` where each key represents a login configuration name and the value represents an `Array` of `AppConfigurationEntry`s.
62
+
The implementation constructor accepts a `Map` where each key represents a login configuration name and the value represents an `Array` of ``AppConfigurationEntry``s.
63
63
`InMemoryConfiguration` also supports a default `Array` of `AppConfigurationEntry` objects that will be used if no mapping is found within the provided `Map`.
64
64
For details, refer to the class level javadoc of `InMemoryConfiguration`.
Copy file name to clipboardExpand all lines: docs/manual/src/docs/asciidoc/_includes/servlet/authentication/rememberme.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -101,7 +101,7 @@ We'll look at these in turn.
101
101
This implementation supports the simpler approach described in <<remember-me-hash-token>>.
102
102
`TokenBasedRememberMeServices` generates a `RememberMeAuthenticationToken`, which is processed by `RememberMeAuthenticationProvider`.
103
103
A `key` is shared between this authentication provider and the `TokenBasedRememberMeServices`.
104
-
In addition, `TokenBasedRememberMeServices` requires A UserDetailsService from which it can retrieve the username and password for signature comparison purposes, and generate the `RememberMeAuthenticationToken` to contain the correct `GrantedAuthority`s.
104
+
In addition, `TokenBasedRememberMeServices` requires A UserDetailsService from which it can retrieve the username and password for signature comparison purposes, and generate the `RememberMeAuthenticationToken` to contain the correct ``GrantedAuthority``s.
105
105
Some sort of logout command should be provided by the application that invalidates the cookie if the user requests this.
106
106
`TokenBasedRememberMeServices` also implements Spring Security's `LogoutHandler` interface so can be used with `LogoutFilter` to have the cookie cleared automatically.
Copy file name to clipboardExpand all lines: docs/manual/src/docs/asciidoc/_includes/servlet/authentication/session-management.adoc
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ This is the default in Servlet 3.1 and newer containers.
186
186
187
187
188
188
When session fixation protection occurs, it results in a `SessionFixationProtectionEvent` being published in the application context.
189
-
If you use `changeSessionId`, this protection will __also__ result in any `javax.servlet.http.HttpSessionIdListener`s being notified, so use caution if your code listens for both events.
189
+
If you use `changeSessionId`, this protection will __also__ result in any ``javax.servlet.http.HttpSessionIdListener``s being notified, so use caution if your code listens for both events.
190
190
See the <<session-mgmt,Session Management>> chapter for additional information.
Copy file name to clipboardExpand all lines: docs/manual/src/docs/asciidoc/_includes/servlet/authorization/acls.adoc
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Using Spring Security as the foundation, you have several approaches that can be
16
16
* Write your business methods to enforce the security.
17
17
You could consult a collection within the `Customer` domain object instance to determine which users have access.
18
18
By using the `SecurityContextHolder.getContext().getAuthentication()`, you'll be able to access the `Authentication` object.
19
-
* Write an `AccessDecisionVoter` to enforce the security from the `GrantedAuthority[]`s stored in the `Authentication` object.
19
+
* Write an `AccessDecisionVoter` to enforce the security from the ``GrantedAuthority[]``s stored in the `Authentication` object.
20
20
This would mean your `AuthenticationManager` would need to populate the `Authentication` with custom ``GrantedAuthority[]``s representing each of the `Customer` domain object instances the principal has access to.
21
21
* Write an `AccessDecisionVoter` to enforce the security and open the target `Customer` domain object directly.
22
22
This would mean your voter needs access to a DAO that allows it to retrieve the `Customer` object.
@@ -26,8 +26,8 @@ It would then access the `Customer` object's collection of approved users and ma
26
26
Each one of these approaches is perfectly legitimate.
27
27
However, the first couples your authorization checking to your business code.
28
28
The main problems with this include the enhanced difficulty of unit testing and the fact it would be more difficult to reuse the `Customer` authorization logic elsewhere.
29
-
Obtaining the `GrantedAuthority[]`s from the `Authentication` object is also fine, but will not scale to large numbers of `Customer`s.
30
-
If a user might be able to access 5,000 `Customer`s (unlikely in this case, but imagine if it were a popular vet for a large Pony Club!) the amount of memory consumed and time required to construct the `Authentication` object would be undesirable.
29
+
Obtaining the ``GrantedAuthority[]``s from the `Authentication` object is also fine, but will not scale to large numbers of ``Customer``s.
30
+
If a user might be able to access 5,000 ``Customer``s (unlikely in this case, but imagine if it were a popular vet for a large Pony Club!) the amount of memory consumed and time required to construct the `Authentication` object would be undesirable.
31
31
The final method, opening the `Customer` directly from external code, is probably the best of the three.
32
32
It achieves separation of concerns, and doesn't misuse memory or CPU cycles, but it is still inefficient in that both the `AccessDecisionVoter` and the eventual business method itself will perform a call to the DAO responsible for retrieving the `Customer` object.
33
33
Two accesses per method invocation is clearly undesirable.
@@ -91,19 +91,19 @@ Now that we've provided a basic overview of what the ACL system does, and what i
91
91
The key interfaces are:
92
92
93
93
94
-
* `Acl`: Every domain object has one and only one `Acl` object, which internally holds the `AccessControlEntry`s as well as knows the owner of the `Acl`.
94
+
* `Acl`: Every domain object has one and only one `Acl` object, which internally holds the ``AccessControlEntry``s as well as knows the owner of the `Acl`.
95
95
An Acl does not refer directly to the domain object, but instead to an `ObjectIdentity`.
96
96
The `Acl` is stored in the ACL_OBJECT_IDENTITY table.
97
97
98
-
* `AccessControlEntry`: An `Acl` holds multiple `AccessControlEntry`s, which are often abbreviated as ACEs in the framework.
98
+
* `AccessControlEntry`: An `Acl` holds multiple ``AccessControlEntry``s, which are often abbreviated as ACEs in the framework.
99
99
Each ACE refers to a specific tuple of `Permission`, `Sid` and `Acl`.
100
100
An ACE can also be granting or non-granting and contain audit settings.
101
101
The ACE is stored in the ACL_ENTRY table.
102
102
103
103
* `Permission`: A permission represents a particular immutable bit mask, and offers convenience functions for bit masking and outputting information.
104
104
The basic permissions presented above (bits 0 through 4) are contained in the `BasePermission` class.
105
105
106
-
* `Sid`: The ACL module needs to refer to principals and `GrantedAuthority[]`s.
106
+
* `Sid`: The ACL module needs to refer to principals and ``GrantedAuthority[]``s.
107
107
A level of indirection is provided by the `Sid` interface, which is an abbreviation of "security identity".
108
108
Common classes include `PrincipalSid` (to represent the principal inside an `Authentication` object) and `GrantedAuthoritySid`.
109
109
The security identity information is stored in the ACL_SID table.
0 commit comments