Hi,
I am getting the below problem while generating JWT with JWKS.
Steps to create JWT with JWKS
Step-1Generate JWKS using a third-party tool (https://mkjwk.org/)
Step-2Configure step-1 key in KVM
{
"keys": [
{
"kty": "EC",
"d": "7MJbpdnCfFODZApvMpjgtVrJsePt2_y-_D3wUkzlUvA",
"use": "enc",
"crv": "P-256",
"kid": "demoid",
"x": "qQy5GfBw9l3ArH-zH61gXtzTDmGZqjN6dAb-8IFpRE4",
"y": "hm1rHBR4vwfJo8W2bH7Um_ui5UAfWj_1UbiMJPd7RlQ",
"alg": "ES256"
}
]
}
Step-3: Using below Policy
<GenerateJWT async="false" continueOnError="false" enabled="true" name="Generate-Guest-JWT-RSA">
<DisplayName>Generate Guest JWT-RSA</DisplayName>
<!-- specify the key and content algorithms -->
<Algorithms>
<Key>ECDH-ES+A256KW</Key>
<Content>A128GCM</Content>
</Algorithms>
<!-- specify the public key to use for encryption -->
<PublicKey>
<JWKS ref="rsa.JWTKey"/>
<!--<Value ref="rsa_publickey"/>-->
</PublicKey>
<!-- any additional configuration elements you like -->
<Subject>application-access</Subject>
<Issuer>urn://apigee-edge-JWT-policy-test</Issuer>
<Audience>guest</Audience>
<ExpiresIn>30m</ExpiresIn>
<OutputVariable>jwt-variable</OutputVariable>
</GenerateJWT>
Step-4: Getting below error with response status code 500
{
"fault": {
"faultstring": "Could not find a matching Public Key: policy(Generate-Guest-JWT-RSA)",
"detail": {
"errorcode": "steps.jwt.NoMatchingPublicKey"
}
}
}
I am using “Apigee Edge free trial” i.e. javaCallout is disabled.
Does Apigee support third-party JWKS? if so, what are the criteria to choose/select an appropriate algorithm for the above (step-2) keys?
I am using JWKS based on https://community.apigee.com/questions/86298/encrypting-jwt-using-jwks.html. Is there any appropriate documentation?
csrfJwtEncryptionKey
Here are reference links but couldn’t get any clue yet. Algorithm:
- https://community.apigee.com/articles/86125/generating-and-verifying-encrypted-jwt-in-apigee.html
- Idon’t want to useNodejs to generate JWKS e.g. Nodejs : https://community.apigee.com/questions/67537/publish-and-generate-jwks.html andhttps://github.com/DinoChiesa/Apigee-JWT-with-JWKS

