Fix rest provider example for kc >= 23

Starting with KC23, a @Path is required for an exposed method to work properly

Fixes #26088

Signed-off-by: Christophe de Vienne <christophe.devienne@orus.io>
This commit is contained in:
Christophe de Vienne 2024-01-10 20:59:33 +01:00 committed by Pedro Igor
parent 16dddfa49c
commit 1945897c85

View file

@ -21,6 +21,7 @@ import org.keycloak.models.KeycloakSession;
import org.keycloak.services.resource.RealmResourceProvider;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
/**
@ -39,7 +40,7 @@ public class HelloResourceProvider implements RealmResourceProvider {
return this;
}
@GET
@GET @Path("")
@Produces("text/plain; charset=utf-8")
public String get() {
String name = session.getContext().getRealm().getDisplayName();