Search in sources :

Example 91 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project jbossws-cxf by jbossws.

the class WSSecurityPolicyExamples21xTestCase method test214.

/**
 * 2.1.4  (WSS 1.1) User Name with Certificates, Sign, Encrypt
 *
 * @throws Exception
 */
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test214() throws Exception {
    Service service = Service.create(new URL(baseURL + "/SecurityService214?wsdl"), serviceName);
    ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService214Port"), ServiceIface.class);
    setupWsse(proxy, false);
    assertTrue(proxy.sayHello().equals("Hello - (WSS 1.1) User Name with Certificates, Sign, Encrypt"));
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) URL(java.net.URL) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest) WrapThreadContextClassLoader(org.jboss.wsf.test.WrapThreadContextClassLoader)

Example 92 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project jbossws-cxf by jbossws.

the class WSSecurityPolicyExamples22xTestCase method test221.

/**
 * 2.2.1 (WSS1.0) X.509 Certificates, Sign, Encrypt
 *
 * This use-case corresponds to the situation where both parties have X.509v3 certificates (and public-private key pairs).
 * The requestor identifies itself to the service. The message exchange is integrity protected and encrypted.
 *
 * @throws Exception
 */
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test221() throws Exception {
    Service service = Service.create(new URL(baseURL + "SecurityService221?wsdl"), serviceName);
    ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService221Port"), ServiceIface.class);
    setupWsse(proxy, true);
    try {
        assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) X.509 Certificates, Sign, Encrypt"));
    } catch (Exception e) {
        throw CryptoCheckHelper.checkAndWrapException(e);
    }
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) URL(java.net.URL) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest) WrapThreadContextClassLoader(org.jboss.wsf.test.WrapThreadContextClassLoader)

Example 93 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project jbossws-cxf by jbossws.

the class WSSecurityPolicyExamples22xTestCase method test222.

/**
 * 2.2.2  (WSS1.0) Mutual Authentication with X.509 Certificates, Sign, Encrypt
 *
 * This use case corresponds to the situation where both parties have X.509v3 certificates (and public-private key pairs).
 * The requestor wishes to identify itself to the service using its X.509 credential (strong authentication).
 * The message exchange needs to be integrity protected and encrypted as well. The difference from previous use case is
 * that the X509 token inserted by the client is included in the message signature (see <ProtectTokens />).
 *
 * @throws Exception
 */
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test222() throws Exception {
    Service service = Service.create(new URL(baseURL + "SecurityService222?wsdl"), serviceName);
    ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService222Port"), ServiceIface.class);
    setupWsse(proxy, true);
    try {
        assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) Mutual Authentication with X.509 Certificates, Sign, Encrypt"));
    } catch (Exception e) {
        throw CryptoCheckHelper.checkAndWrapException(e);
    }
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) URL(java.net.URL) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest) WrapThreadContextClassLoader(org.jboss.wsf.test.WrapThreadContextClassLoader)

Example 94 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project jbossws-cxf by jbossws.

the class WSSecurityPolicyExamples23xTestCase method test2313.

/**
 * 2.3.1.3 (WSS1.0) SAML1.1 Assertion (HK) over SSL
 *
 * @throws Exception
 */
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test2313() throws Exception {
    Service service = Service.create(new URL(serviceURLHttps + "SecurityService2313?wsdl"), serviceName);
    ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService2313Port"), ServiceIface.class);
    Map<String, Object> reqCtx = ((BindingProvider) proxy).getRequestContext();
    SamlCallbackHandler cbh = new SamlCallbackHandler();
    cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:1.0:cm:holder-of-key");
    cbh.setSigned(true);
    reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
    reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
    reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
    reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
    assertTrue(proxy.sayHello().equals("Hello -  (WSS1.0) SAML1.1 Assertion (HK) over SSL"));
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) BindingProvider(javax.xml.ws.BindingProvider) URL(java.net.URL) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest) WrapThreadContextClassLoader(org.jboss.wsf.test.WrapThreadContextClassLoader)

Example 95 with RunAsClient

use of org.jboss.arquillian.container.test.api.RunAsClient in project jbossws-cxf by jbossws.

the class WSSecurityPolicyExamples23xTestCase method test2324.

/**
 * 2.3.2.4 (WSS1.1) SAML1.1/2.0 Sender Vouches with X.509 Certificate, Sign, Encrypt
 *
 * @throws Exception
 */
@Test
@RunAsClient
@WrapThreadContextClassLoader
public void test2324() throws Exception {
    Service service = Service.create(new URL(serviceURL + "SecurityService2324?wsdl"), serviceName);
    ServiceIface proxy = (ServiceIface) service.getPort(new QName(NS, "SecurityService2324Port"), ServiceIface.class);
    Map<String, Object> reqCtx = ((BindingProvider) proxy).getRequestContext();
    SamlCallbackHandler cbh = new SamlCallbackHandler();
    cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:1.0:cm:sender-vouches");
    reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
    reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
    reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
    reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
    reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
    reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
    try {
        assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML1.1/2.0 Sender Vouches with X.509 Certificate, Sign, Encrypt"));
    } catch (Exception e) {
        throw CryptoCheckHelper.checkAndWrapException(e);
    }
}
Also used : QName(javax.xml.namespace.QName) Service(javax.xml.ws.Service) BindingProvider(javax.xml.ws.BindingProvider) URL(java.net.URL) RunAsClient(org.jboss.arquillian.container.test.api.RunAsClient) Test(org.junit.Test) JBossWSTest(org.jboss.wsf.test.JBossWSTest) WrapThreadContextClassLoader(org.jboss.wsf.test.WrapThreadContextClassLoader)

Aggregations

RunAsClient (org.jboss.arquillian.container.test.api.RunAsClient)878 Test (org.junit.Test)862 URL (java.net.URL)492 JBossWSTest (org.jboss.wsf.test.JBossWSTest)410 QName (javax.xml.namespace.QName)289 UserVO (org.olat.user.restapi.UserVO)260 Service (javax.xml.ws.Service)254 UserRestClient (org.olat.test.rest.UserRestClient)254 LoginPage (org.olat.selenium.page.LoginPage)116 NavigationPage (org.olat.selenium.page.NavigationPage)112 CoursePageFragment (org.olat.selenium.page.course.CoursePageFragment)102 File (java.io.File)99 QTI21Page (org.olat.selenium.page.qti.QTI21Page)96 CourseEditorPageFragment (org.olat.selenium.page.course.CourseEditorPageFragment)86 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)82 WebElement (org.openqa.selenium.WebElement)78 UserToolsPage (org.olat.selenium.page.user.UserToolsPage)60 QTI21EditorPage (org.olat.selenium.page.qti.QTI21EditorPage)46 Bus (org.apache.cxf.Bus)44 HashMap (java.util.HashMap)41