Skip to content

Commit f561499

Browse files
ahus1jzheaux
authored andcommitted
Fix Antora cross-references that lead to other pages.
Also using AsciiDoc style listings instead of Markdown style listings, and using explicit section IDs on all cross-references.
1 parent 9b24f66 commit f561499

File tree

7 files changed

+32
-26
lines changed

7 files changed

+32
-26
lines changed

docs/modules/ROOT/pages/reactive/oauth2/access-token.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ fun webFilterChain(http: ServerHttpSecurity): SecurityWebFilterChain {
4949
----
5050
====
5151

52-
You can now leverage Spring Security's <<webclient>> or xref:reactive/registered-oauth2-authorized-client.adoc#webflux-roac[@RegisteredOAuth2AuthorizedClient] support to obtain and use the access token.
52+
You can now leverage Spring Security's xref:reactive/integrations/webclient.adoc[webclient] or xref:reactive/registered-oauth2-authorized-client.adoc#webflux-roac[@RegisteredOAuth2AuthorizedClient] support to obtain and use the access token.

docs/modules/ROOT/pages/reactive/oauth2/resource-server.adoc

+6-4
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,10 @@ fun conversionServiceCustomizer(): BeanFactoryPostProcessor {
504504

505505
Specify your key's location:
506506

507-
```yaml
507+
[source,yaml]
508+
----
508509
key.location: hfds://my-key.pub
509-
```
510+
----
510511

511512
And then autowire the value:
512513

@@ -946,10 +947,11 @@ This startup process is quite a bit simpler than for JWTs since no endpoints nee
946947

947948
Once the application is started up, Resource Server will attempt to process any request containing an `Authorization: Bearer` header:
948949

949-
```http
950+
[source,http]
951+
----
950952
GET / HTTP/1.1
951953
Authorization: Bearer some-token-value # Resource Server will process this
952-
```
954+
----
953955

954956
So long as this scheme is indicated, Resource Server will attempt to process the request according to the Bearer Token specification.
955957

docs/modules/ROOT/pages/servlet/configuration/java.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ The way in which we use `AbstractSecurityWebApplicationInitializer` differs depe
6868
* <<abstractsecuritywebapplicationinitializer-without-existing-spring>> - Use these instructions if you are not using Spring already
6969
* <<abstractsecuritywebapplicationinitializer-with-spring-mvc>> - Use these instructions if you are already using Spring
7070

71+
[[abstractsecuritywebapplicationinitializer-without-existing-spring]]
7172
=== AbstractSecurityWebApplicationInitializer without Existing Spring
7273

7374
If you are not using Spring or Spring MVC, you will need to pass in the `WebSecurityConfig` into the superclass to ensure the configuration is picked up.
@@ -91,6 +92,7 @@ The `SecurityWebApplicationInitializer` will do the following things:
9192
* Automatically register the springSecurityFilterChain Filter for every URL in your application
9293
* Add a ContextLoaderListener that loads the <<jc-hello-wsca,WebSecurityConfig>>.
9394

95+
[[abstractsecuritywebapplicationinitializer-with-spring-mvc]]
9496
=== AbstractSecurityWebApplicationInitializer with Spring MVC
9597

9698
If we were using Spring elsewhere in our application we probably already had a `WebApplicationInitializer` that is loading our Spring Configuration.

docs/modules/ROOT/pages/servlet/oauth2/oauth2-resourceserver.adoc

+6-4
Original file line numberDiff line numberDiff line change
@@ -681,9 +681,10 @@ fun conversionServiceCustomizer(): BeanFactoryPostProcessor {
681681

682682
Specify your key's location:
683683

684-
```yaml
684+
[source,yaml]
685+
----
685686
key.location: hfds://my-key.pub
686-
```
687+
----
687688

688689
And then autowire the value:
689690

@@ -1486,10 +1487,11 @@ This startup process is quite a bit simpler than for JWTs since no endpoints nee
14861487

14871488
Once the application is started up, Resource Server will attempt to process any request containing an `Authorization: Bearer` header:
14881489

1489-
```http
1490+
[source,http]
1491+
----
14901492
GET / HTTP/1.1
14911493
Authorization: Bearer some-token-value # Resource Server will process this
1492-
```
1494+
----
14931495

14941496
So long as this scheme is indicated, Resource Server will attempt to process the request according to the Bearer Token specification.
14951497

docs/modules/ROOT/pages/servlet/saml2/index.adoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ https://www.oasis-open.org/committees/download.php/35389/sstc-saml-profiles-erra
1616
[[servlet-saml2login-spring-security-history]]
1717
Since 2009, support for relying parties has existed as an https://github.com/spring-projects/spring-security-saml/tree/1e013b07a7772defd6a26fcfae187c9bf661ee8f#spring-saml[extension project].
1818
In 2019, the process began to port that into https://github.com/spring-projects/spring-security[Spring Security] proper.
19-
This process is similar to the one started in 2017 for <<oauth2,Spring Security's OAuth 2.0 support>>.
19+
This process is similar to the one started in 2017 for xref:servlet/oauth2/index.adoc[Spring Security's OAuth 2.0 support].
2020

2121
[NOTE]
2222
====

docs/modules/ROOT/pages/servlet/saml2/saml2-login.adoc

+14-14
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,28 @@ https://www.oasis-open.org/committees/download.php/35389/sstc-saml-profiles-erra
1313
[[servlet-saml2login-spring-security-history]]
1414
Since 2009, support for relying parties has existed as an https://github.com/spring-projects/spring-security-saml/tree/1e013b07a7772defd6a26fcfae187c9bf661ee8f#spring-saml[extension project].
1515
In 2019, the process began to port that into https://github.com/spring-projects/spring-security[Spring Security] proper.
16-
This process is similar to the one started in 2017 for <<oauth2,Spring Security's OAuth 2.0 support>>.
16+
This process is similar to the one started in 2017 for xref:servlet/oauth2/index.adoc[Spring Security's OAuth 2.0 support].
1717

1818
[NOTE]
1919
====
2020
A working sample for {gh-samples-url}/servlet/spring-boot/java/saml2-login[SAML 2.0 Login] is available in the {gh-samples-url}[Spring Security Samples repository].
2121
====
2222

2323
Let's take a look at how SAML 2.0 Relying Party Authentication works within Spring Security.
24-
First, we see that, like <<oauth2login, OAuth 2.0 Login>>, Spring Security takes the user to a third-party for performing authentication.
24+
First, we see that, like xref:servlet/oauth2/oauth2-login.adoc[OAuth 2.0 Login], Spring Security takes the user to a third-party for performing authentication.
2525
It does this through a series of redirects.
2626

2727
.Redirecting to Asserting Party Authentication
2828
image::{figures}/saml2webssoauthenticationrequestfilter.png[]
2929

30-
The figure above builds off our <<servlet-securityfilterchain,`SecurityFilterChain`>> and <<servlet-authentication-abstractprocessingfilter, `AbstractAuthenticationProcessingFilter`>> diagrams:
30+
The figure above builds off our xref:servlet/architecture.adoc#servlet-securityfilterchain[`SecurityFilterChain`] and xref:servlet/authentication/architecture.adoc#servlet-authentication-abstractprocessingfilter[`AbstractAuthenticationProcessingFilter`] diagrams:
3131

3232
image:{icondir}/number_1.png[] First, a user makes an unauthenticated request to the resource `/private` for which it is not authorized.
3333

34-
image:{icondir}/number_2.png[] Spring Security's <<servlet-authorization-filtersecurityinterceptor,`FilterSecurityInterceptor`>> indicates that the unauthenticated request is __Denied__ by throwing an `AccessDeniedException`.
34+
image:{icondir}/number_2.png[] Spring Security's xref:servlet/authorization/authorize-requests.adoc#servlet-authorization-filtersecurityinterceptor[`FilterSecurityInterceptor`] indicates that the unauthenticated request is __Denied__ by throwing an `AccessDeniedException`.
3535

36-
image:{icondir}/number_3.png[] Since the user lacks authorization, the <<servlet-exceptiontranslationfilter,`ExceptionTranslationFilter`>> initiates __Start Authentication__.
37-
The configured <<servlet-authentication-authenticationentrypoint,`AuthenticationEntryPoint`>> is an instance of {security-api-url}org/springframework/security/web/authentication/LoginUrlAuthenticationEntryPoint.html[`LoginUrlAuthenticationEntryPoint`] which redirects to <<servlet-saml2login-sp-initiated-factory,the `<saml2:AuthnRequest>` generating endpoint>>, `Saml2WebSsoAuthenticationRequestFilter`.
36+
image:{icondir}/number_3.png[] Since the user lacks authorization, the xref:servlet/architecture.adoc#servlet-exceptiontranslationfilter[`ExceptionTranslationFilter`] initiates __Start Authentication__.
37+
The configured xref:servlet/authentication/architecture.adoc#servlet-authentication-authenticationentrypoint[`AuthenticationEntryPoint`] is an instance of {security-api-url}org/springframework/security/web/authentication/LoginUrlAuthenticationEntryPoint.html[`LoginUrlAuthenticationEntryPoint`] which redirects to <<servlet-saml2login-sp-initiated-factory,the `<saml2:AuthnRequest>` generating endpoint>>, `Saml2WebSsoAuthenticationRequestFilter`.
3838
Or, if you've <<servlet-saml2login-relyingpartyregistrationrepository,configured more than one asserting party>>, it will first redirect to a picker page.
3939

4040
image:{icondir}/number_4.png[] Next, the `Saml2WebSsoAuthenticationRequestFilter` creates, signs, serializes, and encodes a `<saml2:AuthnRequest>` using its configured <<servlet-saml2login-sp-initiated-factory,`Saml2AuthenticationRequestFactory`>>.
@@ -49,23 +49,23 @@ image:{icondir}/number_6.png[] The browser then POSTs the `<saml2:Response>` to
4949
.Authenticating a `<saml2:Response>`
5050
image::{figures}/saml2webssoauthenticationfilter.png[]
5151

52-
The figure builds off our <<servlet-securityfilterchain,`SecurityFilterChain`>> diagram.
52+
The figure builds off our xref:servlet/architecture.adoc#servlet-securityfilterchain[`SecurityFilterChain`] diagram.
5353

5454
image:{icondir}/number_1.png[] When the browser submits a `<saml2:Response>` to the application, it <<servlet-saml2login-authenticate-responses, delegates to `Saml2WebSsoAuthenticationFilter`>>.
5555
This filter calls its configured `AuthenticationConverter` to create a `Saml2AuthenticationToken` by extracting the response from the `HttpServletRequest`.
5656
This converter additionally resolves the <<servlet-saml2login-relyingpartyregistration, `RelyingPartyRegistration`>> and supplies it to `Saml2AuthenticationToken`.
5757

58-
image:{icondir}/number_2.png[] Next, the filter passes the token to its configured <<servlet-authentication-providermanager,`AuthenticationManager`>>.
58+
image:{icondir}/number_2.png[] Next, the filter passes the token to its configured xref:servlet/authentication/architecture.adoc#servlet-authentication-providermanager[`AuthenticationManager`].
5959
By default, it will use the <<servlet-saml2login-architecture,`OpenSAML authentication provider`>>.
6060

6161
image:{icondir}/number_3.png[] If authentication fails, then __Failure__
6262

63-
* The <<servlet-authentication-securitycontextholder, `SecurityContextHolder`>> is cleared out.
64-
* The <<servlet-authentication-authenticationentrypoint,`AuthenticationEntryPoint`>> is invoked to restart the authentication process.
63+
* The xref:servlet/authentication/architecture.adoc#servlet-authentication-securitycontextholder[`SecurityContextHolder`] is cleared out.
64+
* The xref:servlet/authentication/architecture.adoc#servlet-authentication-authenticationentrypoint[`AuthenticationEntryPoint`] is invoked to restart the authentication process.
6565

6666
image:{icondir}/number_4.png[] If authentication is successful, then __Success__.
6767

68-
* The <<servlet-authentication-authentication, `Authentication`>> is set on the <<servlet-authentication-securitycontextholder, `SecurityContextHolder`>>.
68+
* The xref:servlet/authentication/architecture.adoc#servlet-authentication-authentication[`Authentication`] is set on the xref:servlet/authentication/architecture.adoc#servlet-authentication-securitycontextholder[`SecurityContextHolder`].
6969
* The `Saml2WebSsoAuthenticationFilter` invokes `FilterChain#doFilter(request,response)` to continue with the rest of the application logic.
7070

7171
[[servlet-saml2login-minimaldependencies]]
@@ -167,9 +167,9 @@ image:{figures}/opensamlauthenticationprovider.png[]
167167

168168
This figure builds off of the <<servlet-saml2login-authentication-saml2webssoauthenticationfilter,`Saml2WebSsoAuthenticationFilter` diagram>>.
169169

170-
image:{icondir}/number_1.png[] The `Saml2WebSsoAuthenticationFilter` formulates the `Saml2AuthenticationToken` and invokes the <<servlet-authentication-providermanager,`AuthenticationManager`>>.
170+
image:{icondir}/number_1.png[] The `Saml2WebSsoAuthenticationFilter` formulates the `Saml2AuthenticationToken` and invokes the xref:servlet/authentication/architecture.adoc#servlet-authentication-providermanager[`AuthenticationManager`].
171171

172-
image:{icondir}/number_2.png[] The <<servlet-authentication-providermanager,`AuthenticationManager`>> invokes the OpenSAML authentication provider.
172+
image:{icondir}/number_2.png[] The xref:servlet/authentication/architecture.adoc#servlet-authentication-providermanager[`AuthenticationManager`] invokes the OpenSAML authentication provider.
173173

174174
image:{icondir}/number_3.png[] The authentication provider deserializes the response into an OpenSAML `Response` and checks its signature.
175175
If the signature is invalid, authentication fails.
@@ -1306,7 +1306,7 @@ open class SecurityConfig : WebSecurityConfigurerAdapter() {
13061306
----
13071307
====
13081308
<1> First, call the default converter, which extracts attributes and authorities from the response
1309-
<2> Second, call the <<servlet-authentication-userdetailsservice, `UserDetailsService`>> using the relevant information
1309+
<2> Second, call the xref:servlet/authentication/passwords/user-details-service.adoc#servlet-authentication-userdetailsservice[`UserDetailsService`] using the relevant information
13101310
<3> Third, return a custom authentication that includes the user details
13111311

13121312
[NOTE]

docs/modules/ROOT/pages/servlet/test/mockmvc.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ mvc.get("/") {
366366

367367
==== Running as a User in Spring MVC Test with Annotations
368368

369-
As an alternative to using a `RequestPostProcessor` to create your user, you can use annotations described in <<Testing Method Security>>.
369+
As an alternative to using a `RequestPostProcessor` to create your user, you can use annotations described in xref:servlet/test/method.adoc[Testing Method Security].
370370
For example, the following will run the test with the user with username "user", password "password", and role "ROLE_USER":
371371

372372
====
@@ -1903,7 +1903,7 @@ import static org.springframework.security.test.web.servlet.response.SecurityMoc
19031903
==== Exporting the SecurityContext
19041904

19051905
Often times we want to query a repository to see if some `MockMvc` request actually persisted in the database.
1906-
In some cases our repository query uses the <<data,Spring Data Integration>> to filter the results based on current user's username or any other property.
1906+
In some cases our repository query uses the xref:features/integrations/data.adoc[Spring Data Integration] to filter the results based on current user's username or any other property.
19071907
Let's see an example:
19081908

19091909
A repository interface:

0 commit comments

Comments
 (0)