Issue
I have a problem about implementing the process of signup through Keycloak running on docker container through this command
docker run -p 8181:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:18.0.2 start-dev
in my Spring Boot Microservice example.
I already created realm , roles in Keycloak running in Docker.
When I call signup of UserController in userservice, I got this error.
javax.ws.rs.NotFoundException: HTTP 404 Not Found.
I think there is a problem in createUserWithKeycloak method in KeycloakServiceImpl
Response response = keycloak.realm(realm).users().create(userRepresentation);
Here is my project link : Link
Edited 1 (I just updated my repository but nothing changed.)
1 ) Open Keycloak 2 ) Create Realm 3 ) Create Role 4 ) Make a request to http://localhost:9000/api/v1/users/signup Here is my body shown below.
{ "username" : "springbootmicroserviceuser", "password" : "user123456", "name" : "Micro User", "surname" : "User Surname", "phone" : "123456789", "email" : "[email protected]", "role" : "ROLE_USER" }
5 ) I got javax.ws.rs.NotFoundException: HTTP 404 Not Found
Solution
Here is my answer shown below.
keycloak.auth-server-url=http://localhost:8080/auth
in user-service
should be keycloak.auth-server-url=http://localhost:8181/
Answered By - S.N
Answer Checked By - Mildred Charles (JavaFixing Admin)