App Connect

 View Only
  • 1.  Generating JWT Bearer token in ACE ESQL

    IBM Champion
    Posted Sun June 16, 2024 08:45 PM

    Hi,

    I have a requirement to generate JWT Bearer token from Certificate ID. Is there any built in function available in ESQL to generate JWT Bearer token, or what is the recommended way to use in ACE?

    Note: The access token shared by the external application expires in 2 hours. Hence every time if I need to get the access token, I have to regenerate the JWT Bearer token in ACE and get the corresponding access token from the external application.

    Thanks,

    Santhosh Ramanathan



    ------------------------------
    Thanks,
    Santhosh Ramanathan
    ------------------------------


  • 2.  RE: Generating JWT Bearer token in ACE ESQL

    Posted Thu June 27, 2024 07:58 AM

    Hi Santhosh,

    I'm not sure that there is ESQL built in function. I always use a java compute and import the nimbus library.

    https://connect2id.com/products/nimbus-jose-jwt

    Perhaps this can help you.



    ------------------------------
    kim meynendonckx
    ------------------------------



  • 3.  RE: Generating JWT Bearer token in ACE ESQL

    IBM Champion
    Posted Thu July 04, 2024 10:31 PM

    Hi Kim,

    Thanks for the link. Can you please advise how to use this library for Signing using PS256 algorithm

    Thanks,

    Santhosh Ramanathan



    ------------------------------
    Thanks,
    Santhosh Ramanathan
    ------------------------------



  • 4.  RE: Generating JWT Bearer token in ACE ESQL

    Posted Mon July 08, 2024 02:19 AM

    Hi Santosh,

    In the examples you can find an example to generate a JWT with the PS256.

    https://connect2id.com/products/nimbus-jose-jwt/examples/jwt-with-rsa-signature

    The example code generates a private/public key-pair. But I assume you already have created a pair.
    So you need to import your keystore instead of generating one in code.
    You also need to update the claimset with the ones that are required in your use-case.

    It's a good idea to put your token in a GlobalMap for the time that the token is active for reuse.

    Don't forget to put the nimbus jar into your shared-classes, otherwise the deployment won't work.



    ------------------------------
    kim meynendonckx
    ------------------------------



  • 5.  RE: Generating JWT Bearer token in ACE ESQL

    IBM Champion
    Posted Thu July 11, 2024 08:53 PM

    Thanks Kim for sharing the reference. This is of great help



    ------------------------------
    Thanks,
    Santhosh Ramanathan
    ------------------------------