I am calling keycloak api in my project using below code. It is working in Keylcloak 7.0.1. But, it is not working RedHat SSO 7.3.0.GA
Keycloak kc = KeycloakBuilder.builder()
.realm(MASTERREALM)
.username(USERNAME)
.password(PASSWORD)
.serverUrl(SERVER_URL).clientId(CLIENT_ID)
.resteasyClient(new ResteasyClientBuilder().connectionPoolSize(10).build()).build();
UsersResource usersResource = kc.realm(REALM).users();
This is working fine when connecting to Keycloak 7.0.1 using below dependencies
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>7.0.1</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-core</artifactId>
<version>7.0.1</version>
</dependency>
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-common</artifactId>
<version>7.0.1</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jaxrs</artifactId>
<version>3.7.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.7.0.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-jackson2-provider</artifactId>
<version>3.7.0.Final</version>
</dependency>
<!-- Keycloak api dependencies -->
List<UserRepresentation> listUserResource = usersResource.search(strUserName);
My questions:-
1) when I try to connect Red Hat SSO 7.3.0.GA what dependencies I have to use.
I have tried use below dependency. it is throwing maven build error of dependencies are not available in central repository. Since, This artifact is located at Redhat GA repository.
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>7.0.0.redhat-00002</version>
</dependency>
2) How to define Redhat GA repository in pom.xml file
Thanks in advance
From the RedHat docs, include the following in your
~/.m2/settings.xml
file:assuming that you have access to the JBoss EAP Maven repository. You'll need to either enable the
jboss-enterprise-maven-repository
profile on the command line withmvn -Pjboss-enterprise-maven-repository <target>
or by adding:to your
~/.m2/settings.xml
file.