|
104 | 104 | import org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository;
|
105 | 105 | import org.springframework.security.oauth2.server.authorization.client.TestRegisteredClients;
|
106 | 106 | import org.springframework.security.oauth2.server.authorization.config.annotation.web.configuration.OAuth2AuthorizationServerConfiguration;
|
107 |
| -import org.springframework.security.oauth2.server.authorization.context.AuthorizationServerContextHolder; |
108 | 107 | import org.springframework.security.oauth2.server.authorization.jackson2.TestingAuthenticationTokenMixin;
|
109 | 108 | import org.springframework.security.oauth2.server.authorization.settings.AuthorizationServerSettings;
|
110 | 109 | import org.springframework.security.oauth2.server.authorization.settings.ClientSettings;
|
|
126 | 125 | import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
|
127 | 126 | import org.springframework.security.web.context.SecurityContextRepository;
|
128 | 127 | import org.springframework.security.web.util.matcher.RequestMatcher;
|
129 |
| -import org.springframework.stereotype.Controller; |
130 | 128 | import org.springframework.test.web.servlet.MockMvc;
|
131 | 129 | import org.springframework.test.web.servlet.MvcResult;
|
132 | 130 | import org.springframework.util.LinkedMultiValueMap;
|
133 | 131 | import org.springframework.util.MultiValueMap;
|
134 | 132 | import org.springframework.util.StringUtils;
|
135 |
| -import org.springframework.web.bind.annotation.GetMapping; |
136 |
| -import org.springframework.web.bind.annotation.ResponseBody; |
137 | 133 | import org.springframework.web.util.UriComponents;
|
138 | 134 | import org.springframework.web.util.UriComponentsBuilder;
|
139 | 135 | import org.springframework.web.util.UriUtils;
|
@@ -750,15 +746,6 @@ public void requestWhenCustomConsentPageConfiguredThenRedirect() throws Exceptio
|
750 | 746 | assertThat(authorization).isNotNull();
|
751 | 747 | }
|
752 | 748 |
|
753 |
| - // gh-1668 |
754 |
| - @Test |
755 |
| - public void requestWhenCustomConsentPageConfiguredThenAuthorizationServerContextIsAccessible() throws Exception { |
756 |
| - this.spring.register(AuthorizationServerConfigurationCustomConsentPageAccessAuthorizationServerContext.class) |
757 |
| - .autowire(); |
758 |
| - |
759 |
| - this.mvc.perform(get(consentPage).with(user("user"))).andExpect(status().isOk()); |
760 |
| - } |
761 |
| - |
762 | 749 | @Test
|
763 | 750 | public void requestWhenCustomConsentCustomizerConfiguredThenUsed() throws Exception {
|
764 | 751 | this.spring.register(AuthorizationServerConfigurationCustomConsentRequest.class).autowire();
|
@@ -1222,26 +1209,6 @@ SecurityFilterChain authorizationServerSecurityFilterChain(HttpSecurity http) th
|
1222 | 1209 |
|
1223 | 1210 | }
|
1224 | 1211 |
|
1225 |
| - @EnableWebSecurity |
1226 |
| - @Configuration(proxyBeanMethods = false) |
1227 |
| - static class AuthorizationServerConfigurationCustomConsentPageAccessAuthorizationServerContext |
1228 |
| - extends AuthorizationServerConfigurationCustomConsentPage { |
1229 |
| - |
1230 |
| - @Controller |
1231 |
| - class ConsentController { |
1232 |
| - |
1233 |
| - @GetMapping("/oauth2/consent") |
1234 |
| - @ResponseBody |
1235 |
| - String consent() { |
1236 |
| - // Ensure the AuthorizationServerContext is accessible |
1237 |
| - AuthorizationServerContextHolder.getContext().getIssuer(); |
1238 |
| - return ""; |
1239 |
| - } |
1240 |
| - |
1241 |
| - } |
1242 |
| - |
1243 |
| - } |
1244 |
| - |
1245 | 1212 | @EnableWebSecurity
|
1246 | 1213 | @Configuration(proxyBeanMethods = false)
|
1247 | 1214 | static class AuthorizationServerConfigurationCustomConsentRequest extends AuthorizationServerConfiguration {
|
|
0 commit comments