Skip to content

Commit

Permalink
Changing Keycloak API version to Match Keycloak Server Version
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Wiens committed Mar 26, 2024
1 parent 72ee7b2 commit b7cb9fe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 1 addition & 2 deletions jpo-conflictvisualizer-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@
<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-admin-client</artifactId>
<version>23.0.6</version>
<!-- <version>20.0.3</version> -->
<version>21.1.2</version> <!-- Version should match Keycloak Version specified in Conflict Monitor Dockerfile -->
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import java.util.List;
import java.util.Map;

import jakarta.ws.rs.core.Response;
import javax.ws.rs.core.Response;

// import jakarta.ws.rs.core.Response;

import org.apache.commons.lang3.exception.ExceptionUtils;
import org.keycloak.KeycloakPrincipal;
Expand Down Expand Up @@ -170,19 +172,20 @@ public ResponseEntity<List<UserCreationRequest>> findUserCreationRequests(



System.out.println("Requesting New User Creation");
logger.info("Requesting New User Creation");
Response response = keycloak.realm(realm).users().create(user);
System.out.println(response.getStatus() + " " + response.getHeaders());
logger.info(response.getStatus() + " " + response.getHeaders());

if (response.getStatus() == 201) {
System.out.println("User Creation Successful");
logger.info("User Creation Successful");

Query query = userRepo.getQuery(null, null, null, newUserCreationRequest.getEmail(), null, null, null);
userRepo.delete(query);

return ResponseEntity.status(HttpStatus.OK).contentType(MediaType.APPLICATION_JSON)
.body(newUserCreationRequest.toString());
}else{

return ResponseEntity.status(HttpStatus.NOT_MODIFIED).contentType(MediaType.APPLICATION_JSON)
.body(newUserCreationRequest.toString());
}
Expand Down

0 comments on commit b7cb9fe

Please sign in to comment.