Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Error adding REST Enabled SQL with OAuth

rgouwJan 4 2024

Hi all,

  • I have two databases, one with APEX and another with an application schema.
  • On the APEX machine, a standalone ORDS is running servicing APEX and the remote database with the application schema
  • The application schema is REST enabled and protected with OAuth
  • The application REST services are usable with Postman
  • I want to expose these services as REST Enabled SQL in APEX
  • When I create the REST Enabled SQL in APEX I get an error:
    ORA-20001: Authentication failed. ORA-06512: at "APEX_230100.WWV_FLOW_ERROR", line 1473 ORA-06512: at "APEX_230100.WWV_FLOW_ERROR", line 1508
  • During the creation, there is no option to specify the token URL.
    I therefore assume APEX is trying to determine this URL by itself and does so incorrectly.

Postman:

  1. Add a GET request with OAuth2 client credentials and token URL
    postman1.png
  2. Get the token
    postman2.png
  3. Execute the GET request

postman3.png

APEX:

  1. Create an OAuth Web Credential apexCredentials.png
  2. Start the REST Enabled SQL service wizard
    (Yes, I know the port number is different from the Postman URL. This is because I'm running the databases in Docker images, and from the APEX database I need to use 8080 and from my laptop 8023)
    apex1.png
  3. Select the credentialsapex2.png
  4. Test the Serviceapex3.png
  5. The error log from APEX reports:
    APEX - ORA-20001: Authentication failed. ORA-06512: at "APEX_230100.WWV_FLOW_ERROR", line 1473 ORA-06512: at "APEX_230100.WWV_FLOW_ERROR", line 1508apex4.png

What I suspect is that the request for the token is posted to http://localhost:8080/ords/freergw/oauth/token, in stead of http://localhost:8080/ords/freergw/omzis/oauth/token

I also have an unprotected schema in the same database, and this is working just fine:

apex5.png

Does anyone know how this requirement can be implemented?

Kind regards,

Rob

Comments
Post Details
Added on Jan 4 2024
2 comments
573 views