|
|
|
@ -79,6 +79,15 @@ public class ServerHttpBasicAuthenticationConverterTests { |
|
|
|
assertThat(authentication.getCredentials()).isEqualTo("password"); |
|
|
|
assertThat(authentication.getCredentials()).isEqualTo("password"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
public void applyWhenUserPasswordHasColon() { |
|
|
|
|
|
|
|
Mono<Authentication> result = apply(this.request.header(HttpHeaders.AUTHORIZATION, "Basic dXNlcm5hbWU6cGFzczp3b3Jk")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UsernamePasswordAuthenticationToken authentication = result.cast(UsernamePasswordAuthenticationToken.class).block(); |
|
|
|
|
|
|
|
assertThat(authentication.getPrincipal()).isEqualTo("user"); |
|
|
|
|
|
|
|
assertThat(authentication.getCredentials()).isEqualTo("pass:word"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void applyWhenLowercaseSchemeThenAuthentication() { |
|
|
|
public void applyWhenLowercaseSchemeThenAuthentication() { |
|
|
|
Mono<Authentication> result = apply(this.request.header(HttpHeaders.AUTHORIZATION, "basic dXNlcjpwYXNzd29yZA==")); |
|
|
|
Mono<Authentication> result = apply(this.request.header(HttpHeaders.AUTHORIZATION, "basic dXNlcjpwYXNzd29yZA==")); |
|
|
|
|