I have the following in my express app
import bearer from "express-oauth2-jwt-bearer";
// Authorization middleware. When used, the Access Token must
// exist and be verified against the Auth0 JSON Web Key Set.
const checkJwt = bearer.auth({
audience: "https://earth-838.me.dev/node",
issuerBaseURL: "https://auth.me.dev",
});
const checkScopes = bearer.requiredScopes("access:node");
export {checkJwt, checkScopes};
I am looking for the equivilent in Scala and I came across this basic setup…
val jwkStore = new JwkStore("{JWKS_FILE_HOST}")
val keyProvider = new RSAKeyProvider {
override def getPublicKeyById(s: String): RSAPublicKey = {
}
override def getPrivateKey: RSAPrivateKey = {
}
override def getPrivateKeyId: String = {
}
}
try {
val algorithm = Algorithm.RSA256(keyProvider)
val verifier = JWT.require(algorithm).withIssuer("auth0").build //Reusable verifier instance
val jwt = verifier.verify(token)
System.out.println(jwt.getPayload)
} catch {
case exception: JWTVerificationException =>
//Invalid signature/claims
}
But I am not sure where JwksStore comes from and I am not sure how to handle things. Can someone provide an example?