mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-01 09:42:13 +00:00
UriComponentsBuilder.fromHttpUrl->fromUriString
The fromHttpUrl method is deprecated and replaced with fromUriString Closes gh-
This commit is contained in:
parent
38a9aa1da9
commit
11105a5c51
@ -253,7 +253,7 @@ public class Saml2LoginConfigurerTests {
|
|||||||
public void authenticationRequestWhenAuthenticationRequestResolverBeanThenUses() throws Exception {
|
public void authenticationRequestWhenAuthenticationRequestResolverBeanThenUses() throws Exception {
|
||||||
this.spring.register(CustomAuthenticationRequestResolverBean.class).autowire();
|
this.spring.register(CustomAuthenticationRequestResolverBean.class).autowire();
|
||||||
MvcResult result = this.mvc.perform(get("/saml2/authenticate/registration-id")).andReturn();
|
MvcResult result = this.mvc.perform(get("/saml2/authenticate/registration-id")).andReturn();
|
||||||
UriComponents components = UriComponentsBuilder.fromHttpUrl(result.getResponse().getRedirectedUrl()).build();
|
UriComponents components = UriComponentsBuilder.fromUriString(result.getResponse().getRedirectedUrl()).build();
|
||||||
String samlRequest = components.getQueryParams().getFirst("SAMLRequest");
|
String samlRequest = components.getQueryParams().getFirst("SAMLRequest");
|
||||||
String decoded = URLDecoder.decode(samlRequest, "UTF-8");
|
String decoded = URLDecoder.decode(samlRequest, "UTF-8");
|
||||||
String inflated = Saml2Utils.samlInflate(Saml2Utils.samlDecode(decoded));
|
String inflated = Saml2Utils.samlInflate(Saml2Utils.samlDecode(decoded));
|
||||||
@ -264,7 +264,7 @@ public class Saml2LoginConfigurerTests {
|
|||||||
public void authenticationRequestWhenAuthenticationRequestResolverDslThenUses() throws Exception {
|
public void authenticationRequestWhenAuthenticationRequestResolverDslThenUses() throws Exception {
|
||||||
this.spring.register(CustomAuthenticationRequestResolverDsl.class).autowire();
|
this.spring.register(CustomAuthenticationRequestResolverDsl.class).autowire();
|
||||||
MvcResult result = this.mvc.perform(get("/saml2/authenticate/registration-id")).andReturn();
|
MvcResult result = this.mvc.perform(get("/saml2/authenticate/registration-id")).andReturn();
|
||||||
UriComponents components = UriComponentsBuilder.fromHttpUrl(result.getResponse().getRedirectedUrl()).build();
|
UriComponents components = UriComponentsBuilder.fromUriString(result.getResponse().getRedirectedUrl()).build();
|
||||||
String samlRequest = components.getQueryParams().getFirst("SAMLRequest");
|
String samlRequest = components.getQueryParams().getFirst("SAMLRequest");
|
||||||
String decoded = URLDecoder.decode(samlRequest, "UTF-8");
|
String decoded = URLDecoder.decode(samlRequest, "UTF-8");
|
||||||
String inflated = Saml2Utils.samlInflate(Saml2Utils.samlDecode(decoded));
|
String inflated = Saml2Utils.samlInflate(Saml2Utils.samlDecode(decoded));
|
||||||
|
@ -475,7 +475,7 @@ public class OAuth2LoginAuthenticationFilterTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String expandRedirectUri(HttpServletRequest request, ClientRegistration clientRegistration) {
|
private String expandRedirectUri(HttpServletRequest request, ClientRegistration clientRegistration) {
|
||||||
String baseUrl = UriComponentsBuilder.fromHttpUrl(UrlUtils.buildFullRequestUrl(request))
|
String baseUrl = UriComponentsBuilder.fromUriString(UrlUtils.buildFullRequestUrl(request))
|
||||||
.replaceQuery(null)
|
.replaceQuery(null)
|
||||||
.replacePath(request.getContextPath())
|
.replacePath(request.getContextPath())
|
||||||
.build()
|
.build()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user