mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-22 20:12:14 +00:00
Update HttpSecurity javadoc
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
This commit is contained in:
parent
b2325e4176
commit
c2c84c4243
@ -107,7 +107,7 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
|
|||||||
* A {@link HttpSecurity} is similar to Spring Security's XML <http> element in the
|
* A {@link HttpSecurity} is similar to Spring Security's XML <http> element in the
|
||||||
* namespace configuration. It allows configuring web based security for specific http
|
* namespace configuration. It allows configuring web based security for specific http
|
||||||
* requests. By default it will be applied to all requests, but can be restricted using
|
* requests. By default it will be applied to all requests, but can be restricted using
|
||||||
* {@link #requestMatcher(RequestMatcher)} or other similar methods.
|
* {@link #authorizeHttpRequests(Customizer)} or other similar methods.
|
||||||
*
|
*
|
||||||
* <h2>Example Usage</h2>
|
* <h2>Example Usage</h2>
|
||||||
*
|
*
|
||||||
@ -124,7 +124,12 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
|
|||||||
*
|
*
|
||||||
* @Bean
|
* @Bean
|
||||||
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
* public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
* http.authorizeHttpRequests().requestMatchers("/**").hasRole("USER").and().formLogin();
|
* http
|
||||||
|
* .authorizeHttpRequests((authorizeHttpRequests) ->
|
||||||
|
* authorizeHttpRequests
|
||||||
|
* .requestMatchers("/**").hasRole("USER")
|
||||||
|
* )
|
||||||
|
* .formLogin(withDefaults());
|
||||||
* return http.build();
|
* return http.build();
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user