+ }
+
+ @Test
+ public void testPasswordLoginOrgAdmin() throws MalformedURLException, IOException, GigiApiException {
+ URLConnection uc = new URL("https://" + getServerName()).openConnection();
+ addOrgAdmin();
+ cookie = login(orgAdmin.getEmail(), TEST_PASSWORD);
+ loginCertificate = null;
+ uc.addRequestProperty("Cookie", cookie);
+ String content = IOUtils.readURL(uc);
+ assertThat(content, containsString("You need to be logged in via certificate to get access to the organisations."));
+ assertThat(content, containsString("For some actions, e.g. add verification, support, you need to be authenticated via certificate."));
+
+ }
+
+ @Test
+ public void testCertLoginOrgAdmin() throws GeneralSecurityException, IOException, GigiApiException, InterruptedException {
+ cookie = cookieWithCertificateLogin(u);
+ addOrgAdmin();
+ cookie = cookieWithCertificateLogin(orgAdmin);
+
+ URLConnection uc = new URL("https://" + getSecureServerName()).openConnection();
+ authenticate((HttpURLConnection) uc);
+ String content = IOUtils.readURL(uc);
+
+ assertThat(content, containsString("change to organisation administrator context"));
+ assertThat(content, containsString("You are authenticated via certificate, so you will be able to perform all actions."));
+ }