use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class SPNEGOLoginModuleTestCase method testInvalidKerberosSpnegoWorkflow.
/**
* SPNEGO simple scenario - more mechanismTypes is provided and the Kerberos mechanism is the most preferable one. Client
* provides invalid token in the first round.
*/
@Test
@OperateOnDeployment("WEB")
@Ignore("JBEAP-4114")
public void testInvalidKerberosSpnegoWorkflow(@ArquillianResource URL webAppURL) throws Exception {
final URI uri = getServletURI(webAppURL, SimpleSecuredServlet.SERVLET_PATH);
final String[] mechTypes = new String[] { OID_KERBEROS_V5, OID_DUMMY };
assertSpnegoWorkflow(uri, mechTypes, DUMMY_TOKEN, null, false, false);
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class SPNEGOLoginModuleTestCase method testSimpleSpnegoWorkflow.
/**
* SPNEGO simple scenario - only kerberos mechanism is provided with valid token.
*/
@Test
@OperateOnDeployment("WEB")
public void testSimpleSpnegoWorkflow(@ArquillianResource URL webAppURL) throws Exception {
KerberosTestUtils.assumeKerberosAuthenticationSupported();
final URI uri = getServletURI(webAppURL, SimpleSecuredServlet.SERVLET_PATH);
final String[] mechTypes = new String[] { OID_KERBEROS_V5 };
assertSpnegoWorkflow(uri, mechTypes, createNewKerberosTicketForHttp(uri), null, false, true);
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class SPNEGOLoginModuleTestCase method testIdentityPropagation.
/**
* Tests identity propagation by requesting {@link PropagateIdentityServlet}.
*
* @throws Exception
*/
@Test
@OperateOnDeployment("WEB")
public void testIdentityPropagation(@ArquillianResource URL webAppURL) throws Exception {
KerberosTestUtils.assumeKerberosAuthenticationSupported();
final URI servletUri = getServletURI(webAppURL, PropagateIdentityServlet.SERVLET_PATH);
LOGGER.trace("Testing identity propagation " + servletUri);
final String responseBody = Utils.makeCallWithKerberosAuthn(servletUri, "jduke", "theduke", HttpServletResponse.SC_OK);
assertEquals("Unexpected response body.", "jduke@JBOSS.ORG", responseBody);
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class SAML2KerberosAuthenticationTestCase method testJDukeRoles.
/**
* Test roles for jduke user.
*
* @throws Exception
*/
@Test
@OperateOnDeployment(SERVICE_PROVIDER_NAME)
public void testJDukeRoles(@ArquillianResource URL webAppURL, @ArquillianResource @OperateOnDeployment(IDENTITY_PROVIDER_NAME) URL idpURL) throws Exception {
final URI rolesPrintingURL = new URI(webAppURL.toExternalForm() + RolePrintingServlet.SERVLET_PATH.substring(1) + "?test=testDeploymentViaKerberos&" + KerberosServerSetupTask.QUERY_ROLES);
String responseBody = makeCallWithKerberosAuthn(rolesPrintingURL, idpURL.toURI(), "jduke", DUKE_PASSWORD);
final List<String> assignedRolesList = Arrays.asList("TheDuke", "Echo", "Admin");
for (String role : KerberosServerSetupTask.ROLE_NAMES) {
if (assignedRolesList.contains(role)) {
assertThat("Missing role assignment", responseBody, containsString("," + role + ","));
} else {
assertThat("Unexpected role assignment", responseBody, not(containsString("," + role + ",")));
}
}
}
use of org.jboss.arquillian.container.test.api.OperateOnDeployment in project wildfly by wildfly.
the class SAML2KerberosAuthenticationTestCase method testJDukePrincipal.
/**
* Test principal for jduke user.
*
* @throws Exception
*/
@Test
@OperateOnDeployment(SERVICE_PROVIDER_NAME)
public void testJDukePrincipal(@ArquillianResource URL webAppURL, @ArquillianResource @OperateOnDeployment(IDENTITY_PROVIDER_NAME) URL idpURL) throws Exception {
final String cannonicalHost = Utils.getCannonicalHost(mgmtClient);
final URI principalPrintingURL = new URI(webAppURL.toExternalForm() + PrincipalPrintingServlet.SERVLET_PATH.substring(1) + "?test=testDeploymentViaKerberos");
String responseBody = makeCallWithKerberosAuthn(principalPrintingURL, Utils.replaceHost(idpURL.toURI(), cannonicalHost), "jduke", DUKE_PASSWORD);
assertThat("Unexpected principal", responseBody, equalTo("jduke"));
}
Aggregations