File tree 2 files changed +42
-0
lines changed
oauth2-authorization-server/src
main/java/org/springframework/security/config/annotation/web/configuration
test/java/org/springframework/security/config/annotation/web/configuration
2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 15
15
*/
16
16
package org .springframework .security .config .annotation .web .configuration ;
17
17
18
+ import org .springframework .core .Ordered ;
19
+ import org .springframework .core .annotation .Order ;
18
20
import org .springframework .http .HttpMethod ;
19
21
import org .springframework .security .config .annotation .web .builders .HttpSecurity ;
20
22
import org .springframework .security .config .annotation .web .configurers .oauth2 .server .authorization .OAuth2AuthorizationServerConfigurer ;
31
33
* @author Joe Grandja
32
34
* @since 0.0.1
33
35
*/
36
+ @ Order (Ordered .HIGHEST_PRECEDENCE )
34
37
public class OAuth2AuthorizationServerSecurity extends WebSecurityConfigurerAdapter {
35
38
36
39
// @formatter:off
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2020 the original author or authors.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package org .springframework .security .config .annotation .web .configuration ;
17
+
18
+ import org .junit .Test ;
19
+ import org .springframework .core .Ordered ;
20
+ import org .springframework .core .annotation .OrderUtils ;
21
+
22
+ import static org .assertj .core .api .Assertions .assertThat ;
23
+
24
+ /**
25
+ * Tests for {@link OAuth2AuthorizationServerSecurity}.
26
+ *
27
+ * @author Joe Grandja
28
+ */
29
+ public class OAuth2AuthorizationServerSecurityTests {
30
+
31
+ @ Test
32
+ public void assertOrderHighestPrecedence () {
33
+ Integer authorizationServerSecurityOrder = OrderUtils .getOrder (OAuth2AuthorizationServerSecurity .class );
34
+ Integer defaultSecurityOrder = OrderUtils .getOrder (WebSecurityConfigurerAdapter .class );
35
+ assertThat (authorizationServerSecurityOrder ).isNotEqualTo (defaultSecurityOrder );
36
+ assertThat (authorizationServerSecurityOrder ).isEqualTo (Ordered .HIGHEST_PRECEDENCE );
37
+ }
38
+
39
+ }
You can’t perform that action at this time.
0 commit comments