Salesforce

How to use CLIENT-PRINCIPAL to authenticate users

Information

 
TitleHow to use CLIENT-PRINCIPAL to authenticate users
URL NameP144279
Article Number000131557
EnvironmentProduct: OpenEdge
Version: 10.1x, 10.2x, 11.x
OS: All supported platforms
Other: Security
Question/Problem Description
How to use CLIENT-PRINCIPAL to authenticate users.
How to use an external authentication mechanism with ABL
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
In order to use an external system to authorize/authenticate a user logged in the database, do the following steps:

1 - Enable the auditing in the database. Refers to article#  "How to enable auditing for an OpenEdge database ?"

2 - For testing purposes, enforce run-time security. Refers to article#  "How to use the CAN-DO function to implement runtime application security"

3 - Define that a certain table can be queried only by an specific user and do not define a user table in the database.

4 - Go to the database and define a authentication system domain. Start the Data Administration and go to Admin->Security->Authentication System -> Authentication System Domains. Once there, hit the create button to create a domain. This domain along with its key, has to be the one used by the applications. A database can have as many domains as it needs, usually being one domain for each application that access this database.

5 - Run a test application like this:
DEFINE VARIABLE hCP AS HANDLE.
DEFINE VARIABLE MyUUID as RAW.
DEFINE VARIABLE Base64UUID as CHARACTER.
CREATE CLIENT-PRINCIPAL hCP.

MyUUID = GENERATE-UUID.
Base64UUID = BASE64-ENCODE(MyUUID).
hCP:SESSION-ID = Base64UUID.
hCP:USER-ID="user1". /* whatever user  that would have proper access to your tables */
hCP:DOMAIN-NAME="test". /* domain name from the database */
hCP:SEAL("mykey").  /* it has to be the same key from the database */
SET-DB-CLIENT(hCP). /* instead of using setuserid that relies on _user, this function set the database user id to be the user-id attribute */
run <your application>.p /* from that point on, your database user is already set */
Workaround
Notes
The CLIENT-PRINCIPAL object can only be used to connect OpenEdge databases at this time. 
We are considering ways of extending it to work with DataServers in the future but even if OpenEdge domains are setup to use Oracle as its authentication system, we currently have no means of passing the security token into Oracle for authentication at connect time. There is no current task assigned or specifications set for the implementation of the CLIENT-PRINCIPAL object support with DataServer for Oracle. 


References to other documentation:

Progress articles:
000011645, "How to enable auditing for an OpenEdge database ?"
000020310, "How to use the CAN-DO function to implement runtime application security
Keyword Phrase
Last Modified Date11/20/2020 7:26 AM

Powered by