SQLDev: Rest development connection setup to dbcs and https

There are two possible hiccups with the setup of “Rest Development” with SQL Developer 18c, when trying to connect to some https respoint, for example running on a DBcs on OCI.

#1 PKIX path building failed trying to connect after https is specified, basically getting the the error below trying to connect to a RestData service:

Cannot connect to <XX>.
sun.security.validator.ValidatorException: PKIX path building failed: 
sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

The Solution is to add the destination server certificate to the cacerts file from the Java JDK embedded with SQL Developer, for example:

C:\Oracle\SQLDev\182\jdk\lib\security\cacerts
or
C:\Oracle\SQLDev\183\jdk\jre\lib\security\cacerts

At this point, the easiest  is to transfer that certificate file on Linux and run the following command before transferring it back to Windows.

$ORACLE_HOME/jdk/jre/bin/keytool -storepass changeit -import -trustcacerts -keystore cacerts -file <mycertificate> -alias "myalias"

#2 Invalid resource owner credentials during login

The username to be specified is a special user that one can create from the compute instance running ORDS:

cd /u01/app/oracle/product/ords/18.2
or
cd /u01/app/oracle/product/ords/18.3

then

java -jar ords.war user ords_dev   "SQL Developer"
and/or
java -jar ords.war user ords_admin "Listener Administrator"

The command above will store these credentials in the ORDS configuration directory, where the user_name will be specified in clear, for example

/u01/app/oracle/product/ords/config/ords/credentials

Then use ords_dev or ords_admin to connect to the restful admin service to either develop new services or administer the service

Note that when upgrading from Apex 18.1 to 18.2, this is a matter to copy the cacerts file into the new SQLdev directory.