8000 [Keycloak CI] - Cookies Tests - KcOidcBrokerTokenExchangeTest by martin-kanis · Pull Request #40063 · keycloak/keycloak · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[Keycloak CI] - Cookies Tests - KcOidcBrokerTokenExchangeTest #40063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ public void testExternalInternalTokenExchange() throws Exception {

@Test
public void testExternalInternalTokenExchangeUsingIssuer() throws Exception {
RealmResource consumerRealm = realmsResouce().realm(bc.consumerRealmName());
IdentityProviderRepresentation broker C471 = consumerRealm.identityProviders().get(bc.getIDPAlias()).toRepresentation();
assertExternalToInternalExchange(broker.getConfig().get(OIDCIdentityProviderConfigRep.ISSUER), true, false);
assertExternalToInternalExchange(bc.getIDPAlias(), true, false);
}

@Test
Expand Down Expand Up @@ -135,6 +133,9 @@ private void assertExternalToInternalExchange(String subjectIssuer, boolean idTo
if (!representation.getConfig().get("issuer").startsWith(ServerURLs.getAuthServerContextRoot())) {
representation.getConfig().put("issuer", ServerURLs.getAuthServerContextRoot() + "/auth/realms/provider");
}
if (userInfo) {
representation.getConfig().put("userInfoUrl", ServerURLs.getAuthServerContextRoot() + "/auth/realms/provider/protocol/openid-connect/userinfo");
}
identityProviderResource.update(representation);

identityProviderResource.addMapper(hardCodedSessionNoteMapper).close();
Expand Down Expand Up @@ -325,6 +326,10 @@ public void testIgnoredTokenTypesValidationWhenExplicitlyConfigured() throws Exc
IdentityProviderRepresentation idpRep = identityProviderResource.toRepresentation();
idpRep.getConfig().put("disableUserInfo", "true");
idpRep.getConfig().put("disableTypeClaimCheck", "true");
// if auth.server.host != auth.server.host2 we need to update the issuer in the IDP config
if (!idpRep.getConfig().get("issuer").startsWith(ServerURLs.getAuthServerContextRoot())) {
idpRep.getConfig().put("issuer", ServerURLs.getAuthServerContextRoot() + "/auth/realms/provider");
}
identityProviderResource.update(idpRep);
getCleanup().addCleanup(() -> {
idpRep.getConfig().put("disableUserInfo", "false");
Expand All @@ -343,7 +348,7 @@ public void testIgnoredTokenTypesValidationWhenExplicitlyConfigured() throws Exc

Client httpClient = AdminClientUtil.createResteasyClient();
try {
WebTarget exchangeUrl = httpClient.target(OAuthClient.AUTH_SERVER_ROOT)
WebTarget exchangeUrl = httpClient.target(ServerURLs.getAuthServerContextRoot() + "/auth")
.path("/realms")
.path(bc.consumerRealmName())
.path("protocol/openid-connect/token");
Expand Down
Loading
0