Friday, 26 October 2018

Configuring SSL in JCS/SOAcs Server with PFX certificate file

PFX file is the file generated by windows ISS which contains certificate and private key of the certificate. The steps to apply this certificate on java cloud service or soa cloud service are described below.


  1. Export the certificate with its private key from IIS as .pfx file.
  2. Move the .pfx file to the bin folder of keytool in oracle soacs VM
    • Connect to VM through winscp and move the file using opc user.
    • Connect to the VM through putty and change the permissions (chmod) and change owner (chown).
    • Move the file to /u01 (or some other location of your choice)
  3. Now we need to convert the .pfx file to jks. Use the below command to achieve this,
$JAVA_HOME/bin/keytool -v -importkeystore -srckeystore <<pfx_file>> -srcstoretype PKCS12 -destkeystore <<destincation_jks>> -deststoretype JKS

This will ask for destination password (you have to set new password)
Source password: Enter the password of pfx private key
  • View the content of the newly created JKS to obtain the original alias of private key

$JAVA_HOME/bin/ keytool -list -v -keystore <<jks_keystore_created_above>>
Enter keystore password:
Keystore type: JKS
Keystore provider: SUN

Your keystore contains 1 entry

Alias name: <<alias will be printed here>>
  • Change the original alias to a simpler alias
$JAVA_HOME/bin/keytool -keystore <<new_keystore.jsk>> -storepass <<password>> -changealias -alias <<original_alias>> -keypass <<orinial pfx password>> -destalias <<new _alias>>
  • Now the new JKS file is ready which needs to be used as weblogic identity store.
  • Login to weblogic admin console, Lock & edit.
  • Navigate to environment à servers.
  • Select admin server, click on keystores tab
  • Change the keystore to “Custom Identity and Java Trust Store”
Custom Identity Store = <<path of new JKS>>
Custom Identity Keystore Type = JKS
Custom Identity Keystore Passphrase = <<keystore password>>
Confirm Custom Identity Keystore Passphrase = << keystore password >>
  • Go to SSL tab
Private Key Alias= <<Alias that you created in step 5>>
Private Key Passphrase = <<password of private key>>
Confirm Private Key Passphrase = <<password of private key>>
  • Save & Release Configuration.
  • Restart the SSL (from Environment à Servers, control tab)
  • Repeat the above five steps for each managed server.
  • Restart the SSL of each server. Now you can access your server/apps over https.

Tuesday, 17 July 2018

Certificate error while invoking REST adapter in Oracle SOA 12c

You might get into certificate error (valid certificate path not found) while invoking a rest service through rest adapter in Oracle SOA even though you install the certificates using keytool.
To overcome this issue, 
  • Login to EM console
  • Navigate to weblogic Domain --> Security --> Keystore
  • Select the System (row) --> select trust 
  • Click on Manage
  • Import the root certificate
  • Restart the server and it should work.

Monday, 9 July 2018

Merge query & Exposing as a Rest Service in Schema as a Service

In this post, I will describing the steps required to write a merge/upsert query (insert or update) query and expose it as a rest service in Oracle DBCS Schema as a service.

Merge query
Use merge statement to conditionally insert or update data depending on its presence, a process known as upsert. The Merge statement selects data from one or more source tables and updates or inserts into the target table. The merge statement allows you to specify a condition to determine whether to update data from or insert into the target table.

Syntax:

MERGE INTO target_table 
USING source_table 
ON search_condition
    WHEN MATCHED THEN
        UPDATE SET col1 = value1, col2 = value2,...
        WHERE <update_condition>
    WHEN NOT MATCHED THEN
        INSERT (col1,col2,...)
        values(value1,value2,...)

        WHERE <insert_condition>;

In Oracle Schema as a Service

Oracle schema as a service is a database schema which can be accessed only through browser based application called APEX. There are only two ways to perform data exchange with with schema as a service.

  • Accessing by coding applications (in ADF or JEE) in associated JCS SX (SaaS Extensions) service.
  • Exposing queries as RESTful web services.
We will see the second option with merge query,
  • Login to you DBCS Schema as a service.
  • Navigate to SQL Workshop --> Restful Services
  • Click on Create and provide all mandatory fields as per your database object (URI prefix is the base of your URI .
  • Click on "Create Template" to create the URI template for your respective object.
  • Create Handler for the upsert operation. You can select either "POST" or "PUT" as your method. Since we are talking about upsert (merge) operation it is good practice to select PUT.
  • Enter "application/json" in MIME Types Allowed field.
  • Enter your PL sql query in source field.
  • Merge query requires the source from another table, but as always we have  dummy table dual from which we can fetch our input.
  • I am giving the example query to merge into department table below,

begin
merge into dept d 
using (select :deptNo deptNo, :dName dname,:loc loc from dual) s
on (d.deptNo = s.deptNo)
 when matched then update set dname = s.dname, loc=s.loc
  when not matched then insert (deptNo, dname, loc) 
    values (s.deptNo,s.dname, s.loc);
   end;
  • You can frame the URL of this REST service by appending the URI's that you had entered for module and template to the base URL of your schema as a service instance.
  • You can pass the input in the body of the rest service input if json format as mentioned below,
{
"deptNo":"72",
"dName":"Marketing",
"loc":"Texas"
}

The above steps allows you to expose your merge query as rest service and if you want the service to be secure then select "yes" for Requires Secure Access field(which mandates access over ssl) and to attach authentication please follow the steps mentioned in the oracle documentation for adding Restful Service Privileges.

Sunday, 3 June 2018

AWS Introduction - Part 1

I am going through a self learning course on Amazon Web Services (AWS) platform. I will to jotting down my notes in series of posts on different services that AWS offers. Lets get started.
This will be the introduction part 1 where I will be covering the basic concepts of AWS and all the services a very high level.


AWS Global Infrastructure

Region: A region is a physical geographic location which contains two (or more) availability zones.

Availability Zone (AZ): Availability zone is simply a data center within a region. Each region consists of two (or more) availability zones.

AWS Edge Location: Edge locations are end points for AWS which are used for caching the content.


AWS global infrastructure is the base for all AWS services. All the AWS services are built on top the global infrastructure. 


Friday, 18 May 2018

Building ADF applications using Developer cloud service

In this post I will be demonstrating the steps required to build ADF applications using Oracle Developer Cloud Service. I will be using ant to do the build activity, the steps are more or less same even if you are planning to use maven.

  • Create a project and repository in developer cloud service.
  • Check-in all your project code to GIT repository of developer cloud service.
  • Generate the build files (build.xml and build.properties) if not present in your project.
  • Jdeveloper generated build files will work when build in your local environment, when you need to build it in developer cloud service, you need to tweak the files a bit. 
build.properties file

oracle.commons=../../../../oracle_common/
install.dir=../../../..
oracle.home=${env.ORACLE_HOME_12C3}
oracle.jdeveloper.workspace.path=${env.WORKSPACE}/SampleBuildApp.jws
middleware.home=${env.MIDDLEWARE_HOME_12C3}
workspace=${env.WORKSPACE}
oracle.jdeveloper.ant.library=${env.ORACLE_HOME_12C3}/jdev/lib/ant-jdeveloper.jar
oracle.jdeveloper.deploy.dir=${env.WORKSPACE}/ViewController/deploy
oracle.jdeveloper.ojdeploy.path=${oracle.home}/jdev/bin/ojdeploy
javac.nowarn=off
oracle.jdeveloper.project.name=ViewController
oracle.jdeveloper.deploy.outputfile=${env.WORKSPACE}/deploy/${profile.name}
output.dir=classes
javac.deprecation=off
oracle.jdeveloper.deploy.profile.name=*
javac.debug=on

  • Change SampleBuildApp.jws to your application name.
build.xml file

<?xml version="1.0" encoding="windows-1252" ?>

<project xmlns="antlib:org.apache.tools.ant" name="SampleBuildApp" basedir=".">
  <property environment="env" />
  <property file="build.properties"/>
  <target name="deploy" description="Deploy JDeveloper profiles">
    <taskdef name="ojdeploy" classname="oracle.jdeveloper.deploy.ant.OJDeployAntTask" uri="oraclelib:OJDeployAntTask"
             classpath="${oracle.jdeveloper.ant.library}"/>
    <ora:ojdeploy xmlns:ora="oraclelib:OJDeployAntTask" executable="${oracle.jdeveloper.ojdeploy.path}"
                  ora:buildscript="${oracle.jdeveloper.deploy.dir}/ojdeploy-build.xml"
                  ora:statuslog="${oracle.jdeveloper.deploy.dir}/ojdeploy-statuslog.xml">
      <ora:deploy>
        <ora:parameter name="workspace" value="${oracle.jdeveloper.workspace.path}"/>
        <ora:parameter name="profile" value="${oracle.jdeveloper.deploy.profile.name}"/>
        <ora:parameter name="nocompile" value="false"/>
        <ora:parameter name="outputfile" value="${oracle.jdeveloper.deploy.outputfile}"/>
      </ora:deploy>
    </ora:ojdeploy>
  </target>
</project>

  • Don't forget to add the property environment (highlighted in red).
  • Check-in these files to developer cloud service.
  • Create a new build job by selecting the application git repository as source and deploy as build task and in the post build steps select Archive the artifact option and enter deploy/*.ear in files to archive field.
.

  • Run the build operation by clicking build now button.
  • Once the build is completed, you can find the .ear file under deploy folder of artifacts.

  • You can take this file and deploy in you JCS or on-premises environment.

Friday, 19 January 2018

Oracle Intelligent bot platform - Introduction

I am going through an online course from oracle on their Intelligent bot platform of. I will be jotting down the key concepts of this course and platform so that it will act as a quick reference guide for anyone who is starting to work on this technology and for people (like me) who want a quick reference. Let’s get started,

What are Intelligent bots??
A computer program that you can interact with in a conversational manner. The user experience of intelligent bot is to simulate a human being as a conversational partner. There are majorly two types of bots, the simpler ones scans for the keywords in the user input and more sophisticated ones which uses natural language processing (NLP) systems (to understand natural human conversations) .

Building blocks and terminology of Oracle intelligent bots
  •        Intents  
  •        Utterances
  •        Entity
  •        Intelligence
  •        Flow

Let us understand each one of them,

Intent:  Intent is like an use case a bot supports, any unit of work a bot supposed to handle. The key feature of any intelligent bot is “ A bot should be able to resolve the input to the same intention of the user”. Example: Check balance, transfer money etc.

Utterance: The way to connect user input to intents. You need to train the bot by giving utterances. Example for check balance can be what is my balance, tell my balance, how much money in my savings account etc

Entity: A variable element of an intent that you want to parameterize to allow input of different values. Bot resolves intent and then entity. Entity example for check balance intent will be savings, current and credit card.
Oracle intelligent bot has built in entities for common entities like date, currency, address etc.

Intelligence: Heart of any chat bot platform. The ability to understand users natural language conversations using natural language processing (NLP) capability.

Flow: Any Conversion will always have a flow to handle the user interactions.


Sunday, 12 November 2017

Configuring Oracle PCS with Oracle IDCS

This post covers the steps required to configure Oracle PCS (Process Cloud Service) as and application (for SSO) in IDCS (Identity Cloud Service). So let us start,


Configuration in IDCS
  • Login to the IDCS console
  • Go to Applications tab and click on Add
  • Select App Catalog in the pop up
  • Search for Oracle  and select Oracle Cloud.
  • Enter basic details and select Oracle Process Cloud Service in the App links section
  • Enter identity domain, domain name and SSO domain name
    • Identity Domain: your identity domain you can find it in my services dashboard
    • Domain Name: You can find it from your cloud url Eg: XXX.oraclecloud.com
    • SSO Domain name: Same as domain name
  • SSO Configuration
    • Entity ID: “entityID” attribute value from the PCS metadata file
    • Signing Certificate: the Signing certificate downloaded from PCS SSO configuration
  • Download the Signing Certificate and Identity Provider Metadata from this page (which will be used in PCS sso configuration page)
  • Save the configuration and Activate it.
Configuration in PCS


  • Login to PCS cloud services dashboard
  • Click on Users on the top right side
  • Click on SSO Configuration tab and click on Configure SSO button
  • Select import identity provider metadata
  • Choose File and upload the identity provider metadata file (such as idcs_metadata.xml, the one downloaded in IDCS page).
  • Select HTTP POST as SSO protocol.
  • Select User’s Email Address as User Identifier.
  • Select the Name ID as the contained in field
  •  Save the details and you are ready to test it and enable the SSO