Remove FederatedIdentityConfigurer from demo sample

Issue gh-1208
This commit is contained in:
Joe Grandja
2023-05-11 12:31:03 -04:00
parent 2a42bd575f
commit 0f0c9c9747
4 changed files with 16 additions and 124 deletions

View File

@@ -123,7 +123,6 @@ Select from the following use cases to see an example of each:
* I want to <<advanced-use-cases-capture-users>>
* I want to <<advanced-use-cases-map-claims>>
* I want to <<advanced-use-cases-configurer>>
[[advanced-use-cases-capture-users]]
=== Capture Users in a Database
@@ -166,37 +165,3 @@ public OAuth2TokenCustomizer<JwtEncodingContext> idTokenCustomizer() {
return new FederatedIdentityIdTokenCustomizer();
}
----
[[advanced-use-cases-configurer]]
=== Create My Own Configurer
The following example `SecurityConfigurer` combines configuration for all of the above examples into a single reusable component:
.`FederatedIdentityConfigurer`
[source,java]
----
include::{samples-dir}/demo-authorizationserver/src/main/java/sample/federation/FederatedIdentityConfigurer.java[tags=imports;class]
----
The configurer can be applied using the Spring Security DSL as in the following example:
.Apply Configurer
[source,java]
----
http.apply(new FederatedIdentityConfigurer());
----
The configurer also has its own DSL to customize the defaults.
Here's a full example:
.Customize using Configurer
[source,java]
----
http.apply(new FederatedIdentityConfigurer())
.oauth2UserHandler((oauth2User) -> {
// TODO: Handle login of an OAuth2 user...
})
.oidcUserHandler((oidcUser) -> {
// TODO: Handle login of an OIDC user...
});
----