|
1 | 1 | /* |
2 | | - * Copyright 2020-2024 the original author or authors. |
| 2 | + * Copyright 2020-2025 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
31 | 31 | import org.springframework.core.Ordered; |
32 | 32 | import org.springframework.core.annotation.Order; |
33 | 33 | import org.springframework.security.config.Customizer; |
34 | | -import org.springframework.security.config.annotation.SecurityConfigurerAdapter; |
35 | 34 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; |
36 | 35 | import org.springframework.security.oauth2.jwt.JwtDecoder; |
37 | 36 | import org.springframework.security.oauth2.jwt.NimbusJwtDecoder; |
@@ -65,28 +64,6 @@ public SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity h |
65 | 64 | return http.build(); |
66 | 65 | } |
67 | 66 |
|
68 | | - /** |
69 | | - * @param http the {@link HttpSecurity} |
70 | | - * @throws Exception if {@link OAuth2AuthorizationServerConfigurer} could not be |
71 | | - * applied |
72 | | - * @deprecated For removal in 2.0. Use |
73 | | - * {@link HttpSecurity#with(SecurityConfigurerAdapter, Customizer)} and pass in |
74 | | - * {@link OAuth2AuthorizationServerConfigurer#authorizationServer()}. |
75 | | - */ |
76 | | - @Deprecated(since = "1.4", forRemoval = true) |
77 | | - public static void applyDefaultSecurity(HttpSecurity http) throws Exception { |
78 | | - // @formatter:off |
79 | | - OAuth2AuthorizationServerConfigurer authorizationServerConfigurer = |
80 | | - OAuth2AuthorizationServerConfigurer.authorizationServer(); |
81 | | - http |
82 | | - .securityMatcher(authorizationServerConfigurer.getEndpointsMatcher()) |
83 | | - .with(authorizationServerConfigurer, Customizer.withDefaults()) |
84 | | - .authorizeHttpRequests((authorize) -> |
85 | | - authorize.anyRequest().authenticated() |
86 | | - ); |
87 | | - // @formatter:on |
88 | | - } |
89 | | - |
90 | 67 | public static JwtDecoder jwtDecoder(JWKSource<SecurityContext> jwkSource) { |
91 | 68 | Set<JWSAlgorithm> jwsAlgs = new HashSet<>(); |
92 | 69 | jwsAlgs.addAll(JWSAlgorithm.Family.RSA); |
|
0 commit comments