diff --git a/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java b/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java index f7f07e43cf..8c31e1eac8 100755 --- a/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java +++ b/services/src/main/java/org/keycloak/broker/oidc/AbstractOAuth2IdentityProvider.java @@ -47,6 +47,7 @@ import org.keycloak.services.ErrorPage; import org.keycloak.services.ErrorResponseException; import org.keycloak.services.messages.Messages; import org.keycloak.sessions.AuthenticationSessionModel; +import org.keycloak.vault.VaultStringSecret; import javax.ws.rs.GET; import javax.ws.rs.QueryParam; @@ -442,12 +443,14 @@ public abstract class AbstractOAuth2IdentityProvider Time.currentTime()) { AccessTokenResponse tokenResponse = new AccessTokenResponse(); @@ -320,7 +321,7 @@ public class OIDCIdentityProvider extends AbstractOAuth2IdentityProvider + */ +public class KcOidcBrokerVaultConfiguration extends KcOidcBrokerConfiguration { + + public static final KcOidcBrokerVaultConfiguration INSTANCE = new KcOidcBrokerVaultConfiguration(); + + @Override + public IdentityProviderRepresentation setUpIdentityProvider(SuiteContext suiteContext) { + IdentityProviderRepresentation idpRep = super.setUpIdentityProvider(suiteContext); + + idpRep.getConfig().put("clientSecret", VAULT_CLIENT_SECRET); + + return idpRep; + } +} diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerVaultTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerVaultTest.java new file mode 100644 index 0000000000..cf1f4b8200 --- /dev/null +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/KcOidcBrokerVaultTest.java @@ -0,0 +1,12 @@ +package org.keycloak.testsuite.broker; + +/** + * @author Martin Kanis + */ +public class KcOidcBrokerVaultTest extends KcOidcBrokerTest { + + @Override + protected BrokerConfiguration getBrokerConfiguration() { + return KcOidcBrokerVaultConfiguration.INSTANCE; + } +} diff --git a/testsuite/integration-arquillian/tests/base/src/test/resources/vault/consumer_oidc__idp b/testsuite/integration-arquillian/tests/base/src/test/resources/vault/consumer_oidc__idp new file mode 100644 index 0000000000..536aca34db --- /dev/null +++ b/testsuite/integration-arquillian/tests/base/src/test/resources/vault/consumer_oidc__idp @@ -0,0 +1 @@ +secret \ No newline at end of file