Pārlūkot izejas kodu

Polish docs gh-1725

Joe Grandja 8 mēneši atpakaļ
vecāks
revīzija
f75eec91dc

+ 4 - 0
docs/src/main/java/sample/gettingstarted/SecurityConfig.java

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

+ 4 - 0
docs/src/main/java/sample/pkce/SecurityConfig.java

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

+ 4 - 0
docs/src/main/java/sample/registration/SecurityConfig.java

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

+ 4 - 0
docs/src/main/java/sample/sociallogin/SecurityConfig.java

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

+ 4 - 0
docs/src/main/java/sample/userinfo/EnableUserInfoSecurityConfig.java

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

+ 4 - 0
docs/src/test/java/sample/jpa/JpaTests.java

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