Is it possible to provide dynamically the client secret to the built-in OAuth2 API authentication? As I see it, you set the password in Service Center.
Attached are the Studio API mapping screen and the Service Center.
Hi Ricardo Campos,
It’s not feasible to pass dynamic Client ID and Client Secret. However, if that’s not an issue, you can create multiple API consumers with distinct Client IDs and Client Secrets for each.
Thanks
Balaji
Hi guy, I have some solutions for your case:
Solution 1: Go to Service Center choose the Consumed REST API you want in Intergration Tab, then fill in credentials information like this:
Solution 2: Using OnBeforeRequest Action. You should select Client authentication is Send client credentials in body. Then in the OnBeforeRequest you modify RequestText like this:
CustomizedRequest.RequestText = "{
client_id: your_client_id,
client_secret: your_client_secret
}"
Follow this link: https://success.outsystems.com/documentation/11/integration_with_external_systems/rest/consume_rest_apis/use_oauth_2_0_client_flow_authorization_in_consumed_rest_api_web_services/
Hi, Dinh! Thanks for the answer.
Unfortunatelly, the OnBeforeRequest action is not called for the OAuth request, but only for the mapped API request. So, I cannot act before the OAuth authentication. This test I had made with no success.
Regards,Ricardo.
Hi Ricardo,
How many dynamic client id and client secret you have for oauth2.