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/servlet/oauth2/oauth2-client.adoc
+20-65
Original file line number
Diff line number
Diff line change
@@ -505,7 +505,7 @@ One of those extended parameters is the `prompt` parameter.
505
505
[NOTE]
506
506
OPTIONAL. Space delimited, case sensitive list of ASCII string values that specifies whether the Authorization Server prompts the End-User for reauthentication and consent. The defined values are: none, login, consent, select_account
507
507
508
-
The following example shows how to implement an `OAuth2AuthorizationRequestResolver` that customizes the Authorization Request for `oauth2Login()`, by including the request parameter `prompt=consent`.
508
+
The following example shows how to configure the `DefaultOAuth2AuthorizationRequestResolver` with a `Consumer<OAuth2AuthorizationRequest.Builder>` that customizes the Authorization Request for `oauth2Login()`, by including the request parameter `prompt=consent`.
509
509
510
510
[source,java]
511
511
----
@@ -524,72 +524,32 @@ public class OAuth2LoginSecurityConfig extends WebSecurityConfigurerAdapter {
<1> Configure the custom `OAuth2AuthorizationRequestResolver`
583
-
<2> Attempt to resolve the `OAuth2AuthorizationRequest` using the `DefaultOAuth2AuthorizationRequestResolver`
584
-
<3> If an `OAuth2AuthorizationRequest` was resolved than return a customized version else return `null`
585
-
<4> Add custom parameters to the existing `OAuth2AuthorizationRequest.additionalParameters`
586
-
<5> Create a copy of the default `OAuth2AuthorizationRequest` which returns an `OAuth2AuthorizationRequest.Builder` for further modifications
587
-
<6> Override the default `additionalParameters`
588
-
589
-
[TIP]
590
-
`OAuth2AuthorizationRequest.Builder.build()` constructs the `OAuth2AuthorizationRequest.authorizationRequestUri`, which represents the complete Authorization Request URI including all query parameters using the `application/x-www-form-urlencoded` format.
591
551
592
-
For the simple use case, where the additional request parameter is always the same for a specific provider, it can be added directly in the `authorization-uri`.
552
+
For the simple use case, where the additional request parameter is always the same for a specific provider, it may be added directly in the `authorization-uri` property.
593
553
594
554
For example, if the value for the request parameter `prompt` is always `consent` for the provider `okta`, than simply configure as follows:
595
555
@@ -605,24 +565,19 @@ spring:
605
565
----
606
566
607
567
The preceding example shows the common use case of adding a custom parameter on top of the standard parameters.
608
-
Alternatively, if your requirements are more advanced, than you can take full control in building the Authorization Request URI by simply overriding the `OAuth2AuthorizationRequest.authorizationRequestUri` property.
568
+
Alternatively, if your requirements are more advanced, you can take full control in building the Authorization Request URI by simply overriding the `OAuth2AuthorizationRequest.authorizationRequestUri` property.
609
569
610
-
The following example shows a variation of the `customAuthorizationRequest()` method from the preceding example, and instead overrides the `OAuth2AuthorizationRequest.authorizationRequestUri` property.
570
+
[TIP]
571
+
`OAuth2AuthorizationRequest.Builder.build()` constructs the `OAuth2AuthorizationRequest.authorizationRequestUri`, which represents the Authorization Request URI including all query parameters using the `application/x-www-form-urlencoded` format.
572
+
573
+
The following example shows a variation of `authorizationRequestCustomizer()` from the preceding example, and instead overrides the `OAuth2AuthorizationRequest.authorizationRequestUri` property.
0 commit comments