Is it possible to implement a key store in WSO2 Enterprise Integrator?

Viewed 63

Is it possible to implement a key store for external endpoints in the WSO2-Integrator?

I'm building a solution with multiple endpoints that will all have their seperate authorization keys. Currently, these are hard-coded into the sequences: the header is created right before I send the message to the endpoint. The authorization is hard-coded into that header.

Is it possible to create a seperate authorization key file and use the keys there as variables to call upon when you create the header?

Current situation:

<header name="Accept" scope="transport" value="application/json"/>
<header name="Authorization" scope="transport" value="Bearer [authorization key gibberish]"/>
   <call description="Send request to the endpoint">
      <endpoint key="PostEndpoint"/>
   </call>
2 Answers

Given Access Tokens should be stored securely in the server the best option is to use securevault and then extract the required token from Secure Vault within the integration. Once stored you can read a token like the below. Read more from here.

<property expression="wso2:vault-lookup('accesstoken')" name="accesstoken"/>
<header name="Authorization" scope="transport" expression="fn:concat('Bearer ', $ctx:accesstoken)"/>

<call description="Send request to the endpoint">
      <endpoint key="PostexEndpoint"/>
</call>

If you want to just store them in a properties file as key-value pairs you can refer to this document.

You can use a securevault, such as HashiCorp Vault, and call for credentials to be populated when the endpoint is activated.

Go down to the "Client credentials grant type" section.

Related