Skip to content
Snippets Groups Projects
Verified Commit 13d535f5 authored by Ira ¯\_(ツ)_/¯'s avatar Ira ¯\_(ツ)_/¯
Browse files

Remove sample get request and update function call to use new API

parent 09576885
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,6 @@ package org.archlinux.keycloak.mailpass.rest;
import java.security.SecureRandom;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
......@@ -20,7 +19,6 @@ import org.keycloak.models.KeycloakSession;
*/
public class MailPassResource {
@SuppressWarnings("unused")
private final KeycloakSession session;
......@@ -40,17 +38,6 @@ public class MailPassResource {
this.session = session;
}
@GET
@Path("hello")
@Produces("text/plain; charset=utf-8")
public String get() {
String name = session.getContext().getRealm().getDisplayName();
if (name == null) {
name = session.getContext().getRealm().getName();
}
return "Hello " + name;
}
/**
* The custom REST endpoint reachable at {{ base_url }}/realms/{{ realm }}/mailpass/hashify.
*
......
......@@ -20,12 +20,7 @@ public class MailPassRestResource {
public MailPassRestResource(KeycloakSession session) {
this.session = session;
this.auth = new AppAuthManager().authenticateBearerToken(session);
}
@Path("norole")
public MailPassResource getMailPassResource() {
return new MailPassResource(session);
this.auth = new AppAuthManager.BearerTokenAuthenticator(session).authenticate();
}
@Path("roleauth")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment