Layer7 API Management

 View Only
Expand all | Collapse all

How to use JWE tab in the Encode JSON Web Token Assertion?

  • 1.  How to use JWE tab in the Encode JSON Web Token Assertion?

    Posted Jul 16, 2020 01:21 PM
    Encode JSON Web Token Assertion - JWE Tab
    The JWE tab is used to configure the encryption of the payload.

    In the option "Key From Context Variable" we have below options. Could someone provide an example to use any one of the following.

    The source with the public key for encrypting the data. Valid inputs:
    • Context variable pointing to a PEM Base64 encoded public key. Can we directly paste the data in PEM file to the Context Variable assertion?
    • Context variable pointing to an X.509 Certificate (for example, when used with Look up Trusted Certificate assertion)
    • Actual JSON string that represents a JSON Web Key or JSON Web Key Set
    • Context variable pointing to a JSON Web Key or JSON Web Key Set
    • If using 
      Direct use of a shared symmetric key as the Content Encryption Key (CEK)
      , enter a context variable pointing to a JWK/JWKs formatted shared key.
    • If using an algorithm other than Direct use of a shared symmetric key as the Content Encryption Key (CEK), enter a context variable pointing to a JWK/JWKs formatted public key.
    An example for all of them would help a lot to understand?


    ------------------------------
    Regards,
    Yeswin
    ------------------------------


  • 2.  RE: How to use JWE tab in the Encode JSON Web Token Assertion?
    Best Answer

    Posted Jul 16, 2020 02:29 PM
    Edited by Christopher Hackett Aug 18, 2020 05:24 PM

    You can get the sample from this link https://<yourApiGw>/openid/connect/jwks.json

    Create a string JSON key set variable
    with 
    {"keys":[{same as the sample from jwks.json}]}

    and the you can use the key defined for sign or enc  to Sign or ENcrypt you JWT data

    External Ref:

    https://ashleyknowles.net/2019/08/using-json-web-tokens-with-ca-api-gateway/



    ------------------------------
    Pre-Sales Consultant
    CA Southern Africa
    ------------------------------