Skip to content

Commit

Permalink
remove unimplemented endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddavidgit committed Oct 13, 2023
1 parent 1dac406 commit 5caa2ae
Showing 1 changed file with 0 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,6 @@ public SignatureResource(KeycloakSession session) {
this.session = session;
}

/**
* Not implemented yet
*/
@GET
@Path("")
@NoCache
@Produces(MediaType.TEXT_HTML)
public Response getPage() {
LOGGER.debugf("getPage: / endpoint called");

AuthenticationManager.AuthResult authResult = AuthenticationManager.authenticateIdentityCookie(session,
session.getContext().getRealm(), true);

if (authResult == null) {
LOGGER.debugf("getPage: No active session present");
return Response.status(403).build();
}

final InputStream indexHtml = this.getClass().getClassLoader().getResourceAsStream("theme/signature/templates/index.html");
final Response.ResponseBuilder responseBuilder = Response.ok(indexHtml).cacheControl(CacheControlUtil.getDefaultCacheControl());
return responseBuilder.build();
}

/**
* Endpoint in order to create a JWT which includes an arbitrary payload.
* The user calling this endpoint has to be in a session.
Expand All @@ -72,7 +49,6 @@ public Response getPage() {
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response sign(SignRequest signRequest) {
// TODO: CORS
LOGGER.debugf("sign: /sign (POST) endpoint called");

AuthenticationManager.AuthResult authResult = AuthenticationManager.authenticateIdentityCookie(session,
Expand Down Expand Up @@ -110,7 +86,6 @@ private JsonObject createAndSerializeToken(SignRequest signRequest, UserModel us
}

private boolean isPasswordValid(SignRequest signRequest, UserModel userModel) {
//TODO: add support for other authentication methods
String password = signRequest.credentials().get("password");
return password != null && userModel.credentialManager().isValid(UserCredentialModel.password(password));
}
Expand Down

0 comments on commit 5caa2ae

Please sign in to comment.