Reputation: 1
My synapse extracted config looks like this:
<filter source="$ctx:AM_KEY_TYPE" regex="PRODUCTION">
<then>
<property name="api.ut.backendRequestTime"
expression="get-property('SYSTEM_TIME')"/>
<property name="password"
expression="wso2:vault-lookup('PayAdmin-- ZenoAPI51.0')"/>
<property name="unpw"
expression="fn:concat('user',':',get-property('password'))"/>
<property name="Authorization"
expression="fn:concat('Basic ', base64Encode(get-property('unpw')))"
scope="transport"/>
<send>
<endpoint name="PayAdmin--ZenoAPI5_APIproductionEndpoint_0">
<http uri-template="http://localhost:8080/payment/{uri.var.name}"/>
</endpoint>
</send>
</then>
What i want to know is:
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: Bearer 2e13c9b3c8717f43d093cfc7c63994bb" -d "{}" http://<IP address of APIM Server>:8280/Zeno1/1.0.0/payment/name
This curl can only take bearer token but how to pass user/pwd for API and user/pwd for backend in the curl
Upvotes: 0
Views: 220
Reputation: 11
Regarding your second question: For Basic Authentication towards the backend you can configure a general Password in the Publisher in step Implement -> Show More Options -> Endpoint Security Scheme: set to Secured and provide Credentials (see: https://docs.wso2.com/display/AM1100/Basic+Auth)
If user specific credentials have to be provided the user should set the "Authentication: Basic base64(username:password)" in the HTTP header, the header will get passed to the backend.
Upvotes: 1
Reputation: 3011
curl -X POST --header "Content-Type: application/json" --header "Accept: application/json" --header "Authorization: **Basic** **[base64encode(username:password)]**" -d "{}" http://<IP address of APIM Server>:8280/Zeno1/1.0.0/payment/name
[base64encode(username:password)] replace this with base64 encode string of "username:password"
Upvotes: 0