use of org.apache.qpid.server.security.auth.AuthenticationResult in project qpid-broker-j by apache.
the class SimpleAuthenticationManagerTest method testAuthenticateValidCredentials.
public void testAuthenticateValidCredentials() {
AuthenticationResult result = _authenticationManager.authenticate(TEST_USER, TEST_PASSWORD);
assertEquals("Unexpected authentication result", AuthenticationStatus.SUCCESS, result.getStatus());
assertAuthenticated(result);
}
use of org.apache.qpid.server.security.auth.AuthenticationResult in project qpid-broker-j by apache.
the class SimpleAuthenticationManagerTest method testAuthenticateWithCramMd5SaslServerInvalidPassword.
public void testAuthenticateWithCramMd5SaslServerInvalidPassword() throws Exception {
AuthenticationResult result = authenticateCramMd5(TEST_USER, "wrong-password");
assertUnauthenticated(result);
}
use of org.apache.qpid.server.security.auth.AuthenticationResult in project qpid-broker-j by apache.
the class SimpleAuthenticationManagerTest method testAuthenticateWithCramMd5SaslServerInvalidUsername.
public void testAuthenticateWithCramMd5SaslServerInvalidUsername() throws Exception {
AuthenticationResult result = authenticateCramMd5("wrong-user", TEST_PASSWORD);
assertUnauthenticated(result);
}
use of org.apache.qpid.server.security.auth.AuthenticationResult in project qpid-broker-j by apache.
the class OAuth2AuthenticationProviderImplTest method testAuthenticateViaAuthorizationCode.
public void testAuthenticateViaAuthorizationCode() throws Exception {
Map<String, OAuth2MockEndpoint> mockEndpoints = new HashMap<>();
mockEndpoints.put(TEST_TOKEN_ENDPOINT_PATH, createMockTokenEndpoint());
mockEndpoints.put(TEST_IDENTITY_RESOLVER_ENDPOINT_PATH, createMockIdentityResolverEndpoint());
_server.setEndpoints(mockEndpoints);
final NamedAddressSpace mockAddressSpace = mock(NamedAddressSpace.class);
when(mockAddressSpace.getName()).thenReturn("mock");
AuthenticationResult authenticationResult = _authProvider.authenticateViaAuthorizationCode(TEST_VALID_AUTHORIZATION_CODE, TEST_REDIRECT_URI, mockAddressSpace);
assertSuccess(authenticationResult);
}
use of org.apache.qpid.server.security.auth.AuthenticationResult in project qpid-broker-j by apache.
the class OAuth2AuthenticationProviderImplTest method testAuthenticateViaAccessToken.
public void testAuthenticateViaAccessToken() throws Exception {
_server.setEndpoints(Collections.singletonMap(TEST_IDENTITY_RESOLVER_ENDPOINT_PATH, createMockIdentityResolverEndpoint()));
AuthenticationResult authenticationResult = _authProvider.authenticateViaAccessToken(TEST_VALID_ACCESS_TOKEN, null);
assertSuccess(authenticationResult);
}
Aggregations