JWT Token

The JWT token can be obtained from the project team or Pricefx Support.

  1. Create Secure Parameter Security Material in SAP Cloud Integration. The value of the secure parameter is Base64 encoded string of {partition}/{username}:{password}.

     

  2. Configure the security material and host in the adapter.

    boomi.jpg
  3. For non-expiring JWT token:

    1. Store the JWT token in another secure parameter.

    2. Build a flow to run only once to initialize the global variable. See Access secure parameters in scripts.

    3. Extract it with a Groovy script. For more information see https://help.sap.com/docs/cloud-integration/sap-cloud-integration/access-secure-parameters-in-scripts.

      def Message processData(Message message) { def apikey_alias = message.getProperty("secureParameter") def secureStorageService = ITApiFactory.getService(SecureStoreService.class, null) try{ def secureParameter = secureStorageService.getUserCredential(apikey_alias) def jwtToken = secureParameter.getPassword().toString() message.setProperty("jwtToken", jwtToken) } catch(Exception e){ throw new SecureStoreException("Secure Parameter not available") } return message; }
    4. Store this property in a global variable.

    5. Set exchange properties – access-token in the content modifier to this global variable.

       

  4. For refreshable JWT token:

    1. Build a timer flow to refresh it periodically by calling the “Get Token” operation via the Pricefx Integration Adapter.

    2. Extract it with Groovy script extractToken in ExtractToken.groovy in Common Groovy Library. See Reusable Utilities | Common Groovy Library for SAP S/4HANA Integration with Pricefx.

    3. Store this property in a global variable.

    4. Set exchange properties – access-token in the content modifier to this global variable.