Project

General

Profile

Feature #12191

request client-principal and realm hook for REST, WEB and SOAP services

Added by Greg Shah 7 days ago. Updated 7 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:

History

#1 Updated by Greg Shah 7 days ago

Problem

Applications written for PASOE commonly rely on PASOE's security layer to authenticate each web request and attach a CLIENT-PRINCIPAL to it. The 4GL code then reads that principal and makes it the session's identity:

hCP = SESSION:CURRENT-REQUEST-INFO:GetClientPrincipal().
IF VALID-HANDLE(hCP) AND hCP:VALIDATE-SEAL(cDomainKey) THEN
   SECURITY-POLICY:SET-CLIENT(hCP).

The user validation itself is often implemented in 4GL as an OERealm class (Progress.Security.Realm.IHybridRealm: ValidateUser, ValidatePassword, GetAttribute, GetAttributeNames, SetAttribute, RemoveAttribute), which PASOE calls during authentication.

FWD already implements OERequestInfo:GetClientPrincipal() and SetClientPrincipal(), and carries a principal with appserver requests, including one supplied by an Open Client. For REST, WEB and SOAP requests, FWD authenticates with its own web service security, but it does not currently build a principal from that authentication, and it does not call a 4GL realm class.

Work

  1. After FWD authenticates a REST, WEB or SOAP request, build a CLIENT-PRINCIPAL for it (user, domain, roles, login time, session id), seal it with the configured domain access code, and return it from SESSION:CURRENT-REQUEST-INFO:GetClientPrincipal() for the duration of the request.
  2. Add an authentication hook that can delegate user validation to a 4GL class implementing Progress.Security.Realm.IHybridRealm, configured in the directory, so an application's existing realm code can be reused. Call it with the same arguments and sequence as PASOE does, and map its result and attributes (including roles) into the principal.
  3. Map roles from the principal to FWD ACLs, so access rules written as role requirements on URL patterns can be expressed in the FWD configuration.
  4. Check the related built-ins against OpenEdge in this flow: REGISTER-DOMAIN with domain access codes, SEAL, VALIDATE-SEAL, SET-DB-CLIENT, SECURITY-POLICY:SET-CLIENT and GET-CLIENT.
  5. Document the configuration in Securing the Web Services (REST SOAP WEBHANDLER).

Testcases

  • REST, WEB and SOAP requests with valid and invalid credentials: the principal returned by GetClientPrincipal(), its attributes and seal, compared with PASOE for the same realm class.
  • A realm class that rejects a user, accepts with roles, and sets attributes.
  • A request without authentication on an anonymous service: GetClientPrincipal() returns what PASOE returns.
  • Role-based ACL allowing and denying a URL pattern.

Also available in: Atom PDF