Jerry Sebastian
Jerry Sebastian

Reputation: 1

Oracle APEX: Setting up Rest Data Source with OAuth2 authentication and Bearer token

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:

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

Answers (1)

Jordan
Jordan

Reputation: 21

It looks like you're missing a space between

Bearer

and the token.

Upvotes: 0

Related Questions