<dependency>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile</artifactId>
<version>1.2</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAi+cSoZGUaIB6TuT9IBma
15bBIOaUQIfxyyHiLDtpHOu6R7sHHxGSGQqkxIQaF0rq1TLh45cfc4d4Z0D0fUN6
dSvbl5SkccE5u7korkOTcb+ncvUOqLAPzXR6anmjDe3f75I4g6Cwmoy2chYIcz6v
yL9FPHiqBLV7NpldrW/kkUPCjSsuQShxnsG8atf+PE+yO9BlyjS4VRZcRnpfnVDL
gwpq1W5kfWOfmLFfY8zTqWAxweRIb+0w4eXvppf8SYI+a7K09VY5caAJyPvIXxFy
MEWHzsdG9aKcmjAtKr0SJEwj+JXHxuKiXaNdaYLO9RufG+/nNXwbEEUvG5Phd5nm
XwIDAQAB
-----END PUBLIC KEY-----
accepted.issuer=http://localhost:8180/auth/realms/master","authorization_endpoint
@ApplicationPath("api")
@ApplicationScoped
@LoginConfig(authMethod = "MP-JWT")
public class ApplicationConfig extends Application {
}
@Path("rng")
@DenyAll
@RequestScoped
public class RNGController {
@Inject
private RNGService rngService;
@Inject
private JsonWebToken jsonWebToken;
@GET
@Produces(MediaType.APPLICATION_JSON)
public Response generate(
@QueryParam("min") @DefaultValue("0") long min,
@QueryParam("max") @DefaultValue("10") long max) {
System.out.println("token: " + jsonWebToken.getRawToken());
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Dummy Random Number Generator API</display-name>
</web-app>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
</beans>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD GlassFish Application Server 3.0 Servlet 3.0//EN"
"http://www.sun.com/software/appserver/dtds/sun-web-app_3_0-0.dtd">
<glassfish-web-app error-url="">
<context-root>/</context-root>
</glassfish-web-app>
--
You received this message because you are subscribed to the Google Groups "Payara Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to payara-forum...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/payara-forum/89a490e5-8c60-450a-8eb5-eff45be04918%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
There's two things that stand out. First of all, is "src/main/reseources" the actual directory, or is that a typo?
Second thing, in payara-mp-jwt.properties you say you have:Although it should work, you may try a simpler issuer to start with, just to be sure.
Also, doesn't authentication work at all, or is it just the injection failing? What happens if you inject the SecurityContect and check its Principal?
@Context
private SecurityContext securityContext;
System.out.println("principal: " + securityContext.getUserPrincipal());
The core problem is thus not the injection of the token that fails, but authentication does not (correctly) take place.
You may want to turn on logging for the fish.payara.microprofile.jwtauth package.