pac4j

Use jwks_uri from OIDC configuration to check JWT tokens signature


The headless (Clojure) application I'm working on must check calls to its REST API bear a valid signed JWT token (direct client). Said token is delivered to callers by a private authentication service very similar to the one described here (Facebook OIDC). I'm trying to get Pac4j (6.0.0-RC7) to take this OIDC configuration and use the value from field jwks_urk to return whatever is necessary (supposedly an instance of org.pac4j.jwt.credentials.authenticator.JwtAuthenticator) to check token signatures.

Based on the Javadoc, source code, docs, and many examples I can either:

Is there a path I'm missing that would get me an instance of JwtAuthenticator directly from the OIDC configuration URL ?


Solution

  • Currently, you can't instantiate a JwtAuthenticator directly from an OIDC configuration. You may want to use the JWKHelper.

    Feel free to submit a PR to the project.