Browse Source

Polish docs gh-1725

pull/1848/head
Joe Grandja 1 year ago
parent
commit
f75eec91dc
  1. 4
      docs/src/main/java/sample/gettingstarted/SecurityConfig.java
  2. 4
      docs/src/main/java/sample/pkce/SecurityConfig.java
  3. 4
      docs/src/main/java/sample/registration/SecurityConfig.java
  4. 4
      docs/src/main/java/sample/sociallogin/SecurityConfig.java
  5. 4
      docs/src/main/java/sample/userinfo/EnableUserInfoSecurityConfig.java
  6. 4
      docs/src/test/java/sample/jpa/JpaTests.java

4
docs/src/main/java/sample/gettingstarted/SecurityConfig.java

@ -71,6 +71,10 @@ public class SecurityConfig {
authorizationServer authorizationServer
.oidc(Customizer.withDefaults()) // Enable OpenID Connect 1.0 .oidc(Customizer.withDefaults()) // Enable OpenID Connect 1.0
) )
.authorizeHttpRequests((authorize) ->
authorize
.anyRequest().authenticated()
)
// Redirect to the login page when not authenticated from the // Redirect to the login page when not authenticated from the
// authorization endpoint // authorization endpoint
.exceptionHandling((exceptions) -> exceptions .exceptionHandling((exceptions) -> exceptions

4
docs/src/main/java/sample/pkce/SecurityConfig.java

@ -49,6 +49,10 @@ public class SecurityConfig {
authorizationServer authorizationServer
.oidc(Customizer.withDefaults()) // Enable OpenID Connect 1.0 .oidc(Customizer.withDefaults()) // Enable OpenID Connect 1.0
) )
.authorizeHttpRequests((authorize) ->
authorize
.anyRequest().authenticated()
)
// Redirect to the login page when not authenticated from the // Redirect to the login page when not authenticated from the
// authorization endpoint // authorization endpoint
.exceptionHandling((exceptions) -> exceptions .exceptionHandling((exceptions) -> exceptions

4
docs/src/main/java/sample/registration/SecurityConfig.java

@ -44,6 +44,10 @@ public class SecurityConfig {
.authenticationProviders(configureCustomClientMetadataConverters()) // <2> .authenticationProviders(configureCustomClientMetadataConverters()) // <2>
) )
) )
)
.authorizeHttpRequests((authorize) ->
authorize
.anyRequest().authenticated()
); );
// @formatter:on // @formatter:on

4
docs/src/main/java/sample/sociallogin/SecurityConfig.java

@ -45,6 +45,10 @@ public class SecurityConfig {
authorizationServer authorizationServer
.oidc(Customizer.withDefaults()) // Enable OpenID Connect 1.0 .oidc(Customizer.withDefaults()) // Enable OpenID Connect 1.0
) )
.authorizeHttpRequests((authorize) ->
authorize
.anyRequest().authenticated()
)
// Redirect to the OAuth 2.0 Login endpoint when not authenticated // Redirect to the OAuth 2.0 Login endpoint when not authenticated
// from the authorization endpoint // from the authorization endpoint
.exceptionHandling((exceptions) -> exceptions .exceptionHandling((exceptions) -> exceptions

4
docs/src/main/java/sample/userinfo/EnableUserInfoSecurityConfig.java

@ -70,6 +70,10 @@ public class EnableUserInfoSecurityConfig {
authorizationServer authorizationServer
.oidc(Customizer.withDefaults()) // <2> .oidc(Customizer.withDefaults()) // <2>
) )
.authorizeHttpRequests((authorize) ->
authorize
.anyRequest().authenticated()
)
.exceptionHandling((exceptions) -> exceptions .exceptionHandling((exceptions) -> exceptions
.defaultAuthenticationEntryPointFor( .defaultAuthenticationEntryPointFor(
new LoginUrlAuthenticationEntryPoint("/login"), new LoginUrlAuthenticationEntryPoint("/login"),

4
docs/src/test/java/sample/jpa/JpaTests.java

@ -206,6 +206,10 @@ public class JpaTests {
authorizationServer authorizationServer
.oidc(Customizer.withDefaults()) // Enable OpenID Connect 1.0 .oidc(Customizer.withDefaults()) // Enable OpenID Connect 1.0
) )
.authorizeHttpRequests((authorize) ->
authorize
.anyRequest().authenticated()
)
.exceptionHandling((exceptions) -> exceptions .exceptionHandling((exceptions) -> exceptions
.defaultAuthenticationEntryPointFor( .defaultAuthenticationEntryPointFor(
new LoginUrlAuthenticationEntryPoint("/login"), new LoginUrlAuthenticationEntryPoint("/login"),

Loading…
Cancel
Save