Skip to content

Commit f10b1a6

Browse files
Update HttpSecurity javadoc
Signed-off-by: Tran Ngoc Nhan <[email protected]>
1 parent ab870bf commit f10b1a6

File tree

1 file changed

+7
-2
lines changed
  • config/src/main/java/org/springframework/security/config/annotation/web/builders

1 file changed

+7
-2
lines changed

config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
* A {@link HttpSecurity} is similar to Spring Security's XML &lt;http&gt; element in the
108108
* namespace configuration. It allows configuring web based security for specific http
109109
* requests. By default it will be applied to all requests, but can be restricted using
110-
* {@link #requestMatcher(RequestMatcher)} or other similar methods.
110+
* {@link #authorizeHttpRequests(Customizer)} or other similar methods.
111111
*
112112
* <h2>Example Usage</h2>
113113
*
@@ -124,7 +124,12 @@
124124
*
125125
* &#064;Bean
126126
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
127-
* http.authorizeHttpRequests().requestMatchers(&quot;/**&quot;).hasRole(&quot;USER&quot;).and().formLogin();
127+
* http
128+
* .authorizeHttpRequests((authorizeHttpRequests) -&gt;
129+
* authorizeHttpRequests
130+
* .requestMatchers(&quot;/**&quot;).hasRole(&quot;USER&quot;)
131+
* )
132+
* .formLogin(withDefaults());
128133
* return http.build();
129134
* }
130135
*

0 commit comments

Comments
 (0)