Did you try the example does it work?

On 28 September 2016 at 13:35, Mariusz Chruscielewski - Info.nl <mariusz@info.nl> wrote:
I can’t make REST endpoint work, I’m using exactly code supplied in example, I tried also to check how standard endpoints in keycloak code are created, all looks similar:


/**
* @author
<a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
*/
public class HelloResourceProvider implements RealmResourceProvider {

   
private KeycloakSession session;

    public
HelloResourceProvider(KeycloakSession session) {
       
this.session = session;
   
}

   
@GET
    @Produces
(MediaType.TEXT_HTML)
   
@Path("/{action}")
   
public String get(@PathParam("action") String action) {
       
//String requestUri = session.getContext().getUri().getRequestUri().toString();

       
String title = "APP_REQUEST";
        if
(action.equals("auth")) {
            title =
"AUTH_RESPONSE";
       
} else if (action.equals("logout")) {
            title =
"LOGOUT_REQUEST";
       
}

        StringBuilder sb =
new StringBuilder();
       
sb.append("<html><head><title>" + title + "</title></head><body>");
       
UriBuilder base = UriBuilder.fromUri("http://localhost:8180/auth");
       
sb.append("<a href=\"" + RealmsResource.accountUrl(base).build("test").toString() + "\" id=\"account\">account</a>");

       
sb.append("</body></html>");
        return
sb.toString();
   
}

   
@Override
   
public Object getResource() {
       
return this;
   
}

   
@Override
   
public void close() {
    }

}

 

 

But I’m still getting:
 
RESTEASY003815: Subresource for target class has no jax-rs annotations.: nl.vi.keycloak.providers.rest.HelloResourceProvider
 
Can you please help me? Thanks

 

 

Kind Regards,

 

Mariusz Chruscielewski

Software Engineer  |  mariusz@info.nl 

+31 (0)20 530 91 13 | +48 695 555 292

info.nl    making platforms work

Sint Antoniesbreestraat 16  |  1011 HB Amsterdam  |  +31 (0)20 530 91 11

Facebook | Twitter | LinkedIn | Google+

 

 


_______________________________________________
keycloak-user mailing list
keycloak-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user