Currently I'm working with clean kura-osgi project. My aim is to implement JWT authentication, or something similar to it, just to provide secure endpoints. I have tried Authentication filter using name-binding. However seem like, in someway name-binding is not getting registered. In this case I have tested simple maven project, and found out everything works there. There is code:
TestAuth.class
@Path("/test")
public class TestAuth extends Application {
@GET
@Secured
@Produces(MediaType.TEXT_PLAIN)
public String test() {
return "hello";
}
}
name binding interface:
@NameBinding
@Retention(RUNTIME)
@Target({TYPE, METHOD})
public @interface Secured {}
Filter:
@Provider
@PreMatching
@Secured
public class AuthenticationFilter implements ContainerRequestFilter {
public void filter(ContainerRequestContext containerRequestContext) throws IOException {
System.out.println("GG");
}
}
I have checked a lot of ways to fix it, for an example: this but this one seems not to work also.