mirror of
https://github.com/anthonyraymond/joal.git
synced 2024-09-20 15:26:25 +08:00
WebSocketAuthorizationSecurityConfigTest tests
This commit is contained in:
parent
2ff9b24f7b
commit
4c60f2964f
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue