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
The `OAuth2AuthorizedClientManager` is responsible for managing the authorization (or re-authorization) of an OAuth 2.0 Client, in collaboration with one or more `OAuth2AuthorizedClientProvider`(s).
45
72
46
73
The following code shows an example of how to register an `OAuth2AuthorizedClientManager` `@Bean` and associate it with an `OAuth2AuthorizedClientProvider` composite that provides support for the `authorization_code`, `refresh_token`, `client_credentials` and `password` authorization grant types:
@@ -583,7 +610,10 @@ The default implementation of `AuthorizationRequestRepository` is `HttpSessionOA
583
610
584
611
If you have a custom implementation of `AuthorizationRequestRepository`, you may configure it as shown in the following example:
585
612
586
-
[source,java]
613
+
.AuthorizationRequestRepository Configuration
614
+
====
615
+
.Java
616
+
[source,java,role="primary"]
587
617
----
588
618
@EnableWebSecurity
589
619
public class OAuth2ClientSecurityConfig extends WebSecurityConfigurerAdapter {
@@ -601,6 +631,25 @@ public class OAuth2ClientSecurityConfig extends WebSecurityConfigurerAdapter {
601
631
}
602
632
----
603
633
634
+
.Kotlin
635
+
[source,kotlin,role="secondary"]
636
+
----
637
+
@EnableWebSecurity
638
+
class OAuth2ClientSecurityConfig : WebSecurityConfigurerAdapter() {
@@ -645,7 +694,10 @@ It uses an `OAuth2ErrorHttpMessageConverter` for converting the OAuth 2.0 Error
645
694
646
695
Whether you customize `DefaultAuthorizationCodeTokenResponseClient` or provide your own implementation of `OAuth2AccessTokenResponseClient`, you'll need to configure it as shown in the following example:
647
696
648
-
[source,java]
697
+
.Access Token Response Configuration
698
+
====
699
+
.Java
700
+
[source,java,role="primary"]
649
701
----
650
702
@EnableWebSecurity
651
703
public class OAuth2ClientSecurityConfig extends WebSecurityConfigurerAdapter {
@@ -663,6 +715,25 @@ public class OAuth2ClientSecurityConfig extends WebSecurityConfigurerAdapter {
663
715
}
664
716
----
665
717
718
+
.Kotlin
719
+
[source,kotlin,role="secondary"]
720
+
----
721
+
@EnableWebSecurity
722
+
class OAuth2ClientSecurityConfig : WebSecurityConfigurerAdapter() {
0 commit comments