Quick guide to installing ORDS with weblogic and enable default OAuth2.0 security

14

Jun 2018

Quick guide to installing ORDS with weblogic and enable default OAuth2.0 security

  1. Download the binaries from oracle site (http://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/ords-download-174-4426575.html)
  2. Unzip the binaries in a directory where you have the weblogic running
  3. Run the following command to install the ords

/opt/oracle/product1213/jdk1.8.0_161/bin/java -jar ords.war install advanced

Enter the name of the database server [localhost]:database-scan.na.lzb.hq

Enter the database listen port [1521]:<Enter unless port is different>
Enter 1 to specify the database service name, or 2 to specify the database SID [1]: <Enter>
Enter the database service name:database_service_name
Enter 1 if you want to verify/install Oracle REST Data Services schema or 2 to skip this step [1]:
Enter the database password for ORDS_PUBLIC_USER:
Confirm password:

Retrieving information.
Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]:2
Invalid value. Try again.
Enter 1 if you want to use PL/SQL Gateway or 2 to skip this step.
If using Oracle Application Express or migrating from mod_plsql then you must enter 1 [1]:2
May 09, 2018 6:08:49 PM
INFO: Updated configurations: defaults, apex_pu
May 09, 2018 6:08:49 PM oracle.dbtools.rt.config.setup.SchemaSetup install
INFO: Oracle REST Data Services schema version 17.4.1.353.06.48 is installed.
Enter 1 if you wish to start in standalone mode or 2 to exit [1]:2

 

In the weblogic domain, please update the managed server startup arguments to include the following values (Known issue in 12c weblogic domains)

 

-Dcom.sun.xml.ws.spi.db.BindingContextFactory=com.sun.xml.ws.db.glassfish.JAXBRIContextFactory -Djavax.xml.bind.JAXBContext=com.sun.xml.bind.v2.ContextFactory -Djava.awt.headless=true

 

Also in the config.xml for the domain, add the following value so that basic auth credentials is not enforced

 

<enforce-valid-basic-auth-credentials>false</enforce-valid-basic-auth-credentials>

 

 

After the changes, restart the managed servers and admin server for the domain and continue with the ords application deployment. Deploy the following wars in to weblogic and target them to your managed servers

 

ords.war

i.war (If you dont already have it, create one for the images)

 

Creating a REST service on the Database and protecting using OAuth2.0

 

2018-06-14_15-29-59

2018-06-14_15-33-27

 

Testing the REST Service using postman:
First get a new access token by passing the client credentials

2018-06-14_15-35-54

 

Once you have the access token call the REST service using the access token as shown below:

 

2018-06-14_15-41-11

 

Post Your Thoughts

Your email address will not be published. Required fields are marked *