WebSocketAuthorizationSecurityConfigTest tests

This commit is contained in:
anthonyraymond 2018-04-10 00:41:59 +02:00
parent 2ff9b24f7b
commit 4c60f2964f
2 changed files with 18 additions and 1 deletions

View file

@ -37,7 +37,7 @@ public class WebSocketAuthenticatorService {
throw new BadCredentialsException("Authentication token does not match the expected token");
}
// Everithing is fine, return an authenticated Authentication. (the constructor with grantedAuthorities auto set authenticated = true)
// Everything is fine, return an authenticated Authentication. (the constructor with grantedAuthorities auto set authenticated = true)
// null credentials, we do not pass the password along to prevent security flaw
return new UsernamePasswordAuthenticationToken(
username,

View file

@ -0,0 +1,17 @@
package org.araymond.joal.web.config.security;
import org.junit.Test;
import static org.assertj.core.api.Assertions.*;
import static org.assertj.core.api.Assertions.assertThat;
public class WebSocketAuthorizationSecurityConfigTest {
@Test
public void shouldDisableCSRFProtection() {
final WebSocketAuthorizationSecurityConfig config = new WebSocketAuthorizationSecurityConfig();
assertThat(config.sameOriginDisabled()).isTrue();
}
}