You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bu...@apache.org on 2021/11/25 19:59:59 UTC
[cxf-fediz] branch master updated: revert intermediate test changes
This is an automated email from the ASF dual-hosted git repository.
buhhunyx pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git
The following commit(s) were added to refs/heads/master by this push:
new fd989f4 revert intermediate test changes
fd989f4 is described below
commit fd989f4e622fa44aca520a2ca13a4007b2764d2f
Author: Alexey Markevich <bu...@gmail.com>
AuthorDate: Thu Nov 25 22:59:22 2021 +0300
revert intermediate test changes
---
.../cxf/fediz/systests/oidc/AbstractOIDCTest.java | 69 +---------------------
1 file changed, 2 insertions(+), 67 deletions(-)
diff --git a/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/AbstractOIDCTest.java b/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/AbstractOIDCTest.java
index d890dca..70e23f9 100644
--- a/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/AbstractOIDCTest.java
+++ b/systests/oidc/src/test/java/org/apache/cxf/fediz/systests/oidc/AbstractOIDCTest.java
@@ -45,7 +45,6 @@ import javax.servlet.ServletResponse;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriBuilder;
-import com.gargoylesoftware.htmlunit.CookieManager;
import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
import com.gargoylesoftware.htmlunit.HttpMethod;
import com.gargoylesoftware.htmlunit.Page;
@@ -92,8 +91,8 @@ import static org.junit.Assert.fail;
*/
abstract class AbstractOIDCTest {
- private static final Integer IDP_HTTPS_PORT = Integer.getInteger("idp.https.port", 12345);
- private static final Integer RP_HTTPS_PORT = Integer.getInteger("rp.https.port", 23456);
+ private static final Integer IDP_HTTPS_PORT = Integer.getInteger("idp.https.port");
+ private static final Integer RP_HTTPS_PORT = Integer.getInteger("rp.https.port");
private static final String CALLBACK_CONTEXT = "/callback";
private static final String REDIRECT_URL = "https://localhost:" + RP_HTTPS_PORT + CALLBACK_CONTEXT;
@@ -473,69 +472,6 @@ abstract class AbstractOIDCTest {
}
@org.junit.Test
- public void testOIDCLoginDifferentClients() throws Exception {
- final UriBuilder authorizationUrlConfidential = oidcEndpointBuilder("/idp/authorize")
- .queryParam("client_id", confidentialClientId)
- .queryParam("response_type", "code")
- .queryParam("scope", "openid");
-
- CookieManager cookieManager = new CookieManager();
- WebClient webClient = setupWebClientIDP("alice", "ecila");
- webClient.setCookieManager(cookieManager);
-
-
- // Login to the OIDC authorization endpoint + get the authorization code
-// String authorizationCode = webClient.getPage(authorizationUrlConfidential.build().toURL()).getWebResponse().getContentAsString();
- String authorizationCode = login(authorizationUrlConfidential, webClient).getWebResponse().getContentAsString();
- System.out.println("authorizationCode " + authorizationCode);
-
- // Now use the code to get an IdToken
- final Map<String, Object> jsonConfidential =
- getTokenJson(authorizationCode, confidentialClientId, confidentialClientSecret);
- System.out.println(jsonConfidential);
-
- // Check the IdToken
- validateIdToken(getIdToken(jsonConfidential), confidentialClientId);
-
- final UriBuilder authorizationUrlPublic = oidcEndpointBuilder("/idp/authorize")
- .queryParam("client_id", publicClientId)
- .queryParam("response_type", "code")
- .queryParam("scope", "openid")
- .queryParam("redirect_uri", REDIRECT_URL);
-
- // Login to the OIDC authorization endpoint + get the authorization code
- authorizationCode = webClient.getPage(authorizationUrlPublic.build().toURL()).getWebResponse().getContentAsString();
- System.out.println("authorizationCode " + authorizationCode);
-
- // Now use the code to get an IdToken
- final Map<String, Object> jsonPublic =
- getTokenJson(authorizationCode, publicClientId, null);
- System.out.println(jsonPublic);
-
- // Check the IdToken
- validateIdToken(getIdToken(jsonPublic), publicClientId);
- }
-
- @org.junit.Test
- public void testImplicitFlow() throws Exception {
- final UriBuilder authorizationUrl = oidcEndpointBuilder("/idp/authorize")
- .queryParam("client_id", publicClientId)
- .queryParam("response_type", "id_token")
- .queryParam("scope", "openid")
- .queryParam("redirect_uri", REDIRECT_URL)
- .queryParam("nonce", "1234565635");
-
- CookieManager cookieManager = new CookieManager();
- WebClient webClient = setupWebClientIDP("alice", "ecila");
- webClient.setCookieManager(cookieManager);
-
-
- // Login to the OIDC authorization endpoint + get the authorization code
- String authorizationCode = loginAndGetAuthorizationCode(authorizationUrl, "alice", "ecila");
- System.out.println("authorizationCode " + authorizationCode);
- }
-
- @org.junit.Test
public void testUsingCodeForOtherClient() throws Exception {
// Get the code for the first client
final UriBuilder authorizationUrl = oidcEndpointBuilder("/idp/authorize")
@@ -1071,7 +1007,6 @@ abstract class AbstractOIDCTest {
private static WebClient setupWebClient(int port, String user, String password) {
final WebClient webClient = new WebClient();
-
webClient.getOptions().setUseInsecureSSL(true);
if (-1 != port && null != password) {
webClient.getCredentialsProvider().setCredentials(