Reputation: 1
I am trying to setup a rest data source in APEX with the rest end point created in ORDS. The rest end points are secured with OAuth2- client credentials. In postman, I could get the access token from the OAuth end point using client id & secret and use it as bearer token in my API call without any issues.
However, I was not successful in setting the rest data source with OAuth2 authentication in APEX. Here are the steps i followed. (My APEX version is 22.1.4)
APEX:
Create Rest Data Source - from scratch
Rest Data Source Type -> Oracle Rest Data Source URL End Point: https://myserverpath/ords/demo/leave/getLeave
Base Path: https://myserverpath/ords/demo/ Service URL Path: leave/getLeave
Authentication Type: OAuth2 Client Credentials Flow OAuth Token URL: https://myserverpath/ords/demo/oauth/token
Client id: redacted
Client Secret:redacted
Discover: gives error "Discovery error: Oracle APEX cannot compute a data profile from the response data of type: text/html."
Selected "Create Rest Resource Manually"
Created a IG on the RDS turned debug on while running the IG and debug message below
Found token "ACCESS_TOKEN".
Access token still valid (expiry=2022-09-13 22:21:59)
begin_request p_url=>https://myserverpath/ords/demo/leave/getLeave?limit=51,p_method=>GET,p_proxy_override=>,p_transfer_timeout=>,p_https_host=>,p_wallet_path=>
Loading instance wallet
set_header Proxy-Connection: Keep-Alive
set_header Content-Type: application/vnd.oracle.resource+json;type=filter-form;charset=UTF-8
set_header User-Agent: Oracle APEX
set_header Authorization: ***
HTTP response 401 - Unauthorized
Curl Command that works:
curl --location --request GET 'https://myserverpath/ords/demo/leave/getLeave' --header 'Authorization: Bearer <bearer_token>'
Is there any step I am missing while setting up rest data source in APEX?
Upvotes: 0
Views: 2811