<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Rana Saeed on Medium]]></title>
        <description><![CDATA[Stories by Rana Saeed on Medium]]></description>
        <link>https://medium.com/@rana.saeed?source=rss-a47390ed79f6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*4X525n8gLK0qlhK341zp-A.jpeg</url>
            <title>Stories by Rana Saeed on Medium</title>
            <link>https://medium.com/@rana.saeed?source=rss-a47390ed79f6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 12:00:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rana.saeed/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integrating Real Application Security (RAS)with Oracle APEX]]></title>
            <link>https://medium.com/@rana.saeed/integrating-real-application-security-ras-with-oracle-apex-33892967beff?source=rss-a47390ed79f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/33892967beff</guid>
            <category><![CDATA[rass]]></category>
            <category><![CDATA[low-code]]></category>
            <category><![CDATA[oracle-apex]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Rana Saeed]]></dc:creator>
            <pubDate>Wed, 26 Apr 2023 06:54:03 GMT</pubDate>
            <atom:updated>2023-04-26T06:54:03.381Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Integrating Real Application Security (RAS) with Oracle APEX</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*X-5DwHQ0D0-7foOfTBmvxQ.png" /></figure><p>The benefits of <a href="https://apex.oracle.com/en/">Oracle APEX</a> are not only limited to its low-code features and attributes, but also, in the underlying power of its seamless integration into Oracle databases architecture. One of such benefits is the ability to utilize security features in the database within our applications. In this blog post, we will explore the use-case for enabling RAS with Oracle Application Express (APEX).</p><h4>Introduction to RAS</h4><p>Let’s start with understanding what is RAS? <a href="https://www.oracle.com/database/technologies/real-application-security.html#:~:text=Oracle%20RAS%20provides%20a%20declarative,operate%20on%20those%20business%20objects.">Real Application Security (RAS)</a> is a powerful feature of Oracle Database that allows users to create security policies that control user access to database resources. It is a useful tool that can help organizations manage their security by providing a more granular way to control access to their database resources. Oracle RAS introduces a policy-based authorization model that can recognize application-level users, privileges, and roles within the database and can also control both static and dynamic collections of records.</p><p>The Oracle RAS model includes several key components such as:</p><ul><li><strong>Application Users:</strong> end-users of an application who do not own any database objects or resources.</li><li><strong>Application Privileges:</strong> named privileges that control the execution of application-level operations.</li><li><strong>Application Roles:</strong> groups of application privileges or other application or database roles.</li><li><strong>Data Realms: </strong>logical sets of rows in a table or a group of related application tables that represent application-level resources or business objects.</li><li><strong>Access control lists (ACLs):</strong> named lists of privilege grants to users or roles, with constraints on the privilege grants.</li><li><strong>Data Security Policies:</strong> policies that protect data realms by associating them with ACLs.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6sIp3YUra2X51RVXtePKHw.png" /><figcaption>Three dimensions of Data Security</figcaption></figure><h4>Benefits of Enabling RAS in APEX</h4><p>So it may seem quite clear what the purpose of RAS is in the Oracle database. But what would be the benefit of enabling such feature in APEX applications?</p><p>Enabling RAS in Oracle APEX provides several benefits, including:</p><ol><li><strong>Enhanced Security:</strong> RAS provides a more granular way to control access to database resources. With RAS, you can define fine-grained security policies that allow or deny access to specific database objects like a SSN column in your table for example. This helps to reduce the risk of unauthorized access to sensitive data.</li><li><strong>Better Auditing:</strong> RAS provides a robust auditing framework that enables you to track user activity and monitor changes to your security policies. Application sessions allow the end-user identity and associated attributes to be conveyed securely to the database, which helps to ensure compliance with regulatory requirements and provides a complete audit trail of all database activity.</li><li><strong>Simplified Administration</strong>: With RAS, you can centralize security administration and management. This makes it easier to manage security policies across multiple database instances and simplifies the process of granting and revoking access to database resources.</li><li><strong>Security without Performance Trade-off:</strong> The majority of current systems have security measures that are either built directly into the applications or are external but require multiple round-trips, which can have a negative impact on performance. However, RAS is natively integrated into the database, offering a security solution that doesn’t sacrifice performance.</li></ol><p>In additon to these points, RAS in APEX can help to signficantly decrease development efforts relating to security as it is natively integrated within APEX. APEX developers do not need to write any specific code for RAS policy enforcement. There are check operators available to enforce the authorization rules so we can show application items based on the RAS access control policy.</p><h4>Difference between RAS and APEX Authorization &amp; ACLs</h4><p>Now, you maybe wondering, how would this be different that utilising APEX’s <a href="https://docs.oracle.com/en/database/oracle/apex/22.2/htmdb/how-access-control-works.html">Authorization Schemes and Access Control</a>?</p><p>First, APEX Authorization is a built-in feature of Oracle APEX that allows you to define authorization schemes based on roles and privileges. APEX Authorization is useful for controlling access to APEX components, such as pages and regions, but it does not provide fine-grained control over access to database objects.</p><p>On the other hand, RAS provides a more granular way to control access to database resources as discussed earlier. With RAS, you can define security policies that allow or deny access to specific database objects, such as tables, views, and procedures.</p><p>RAS also provides a more centralized way to manage security policies for multiple applications and users.</p><h4>Integrating RAS with APEX</h4><p>Let’s now discuss the overall steps on enabling RAS in our APEX applications.</p><ol><li>Create a RAS policy with the necessary privileges for your APEX application. This can be done using SQL commands.</li><li>Create the RAS user and grant them the RAS role that corresponds to the policy created in step 1.</li><li>Create an APEX authentication scheme that uses the RAS user as the authentication source.</li><li>Create an APEX authorization scheme that references the RAS policy created in step 1.</li><li>Apply the authorization scheme to the appropriate APEX pages and components</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/721/1*Hp9wSaxoiP3vKG74rH7kUA.png" /><figcaption>RAS in APEX</figcaption></figure><h4>General guideline for RAS in APEX for Healthcare usecase</h4><p>To better understand how this is applied, here is an overview on how we can apply RAS in APEX to implement Healthcare app requirements where we can ensure that only authorized personnel can access patient records, test results, and other confidential information.</p><p><strong>Prerequisites:<br></strong>Before you start, you will need access to the following:</p><ol><li>An Oracle Cloud account with access to an autonomous database .</li><li>An APEX workspace with an app that we want to secure with RAS.</li><li>A user with Admin access on ADB.</li></ol><ul><li>We start by enabling RAS on ADB. Connect as admin with SQL Devleoper web or your preferred SQL client.</li><li>Perform system privilege grants to the database user associated with the APEX workspace.</li></ul><pre>grant create role to schema_name; <br>exec xs_admin_cloud_util.grant_system_privilege(&#39;ADMIN_ANY_SEC_POLICY&#39;,&#39;SCHEMA_NAME&#39;);</pre><ul><li>From our SQL client, we will sign in as the created database user and create the dynamic application role that will be used in APEX.</li><li>We then create a DB role and grant it to our application role</li></ul><pre>exec sys.xs_principal.create_dynamic_role(name =&gt; &#39;ras_poc&#39;);<br>create role db_ras_poc<br>grant db_ras_poc to ras_poc;</pre><ul><li>We also need to grant the required database object to the privileges created DB role.</li></ul><pre>grant select, insert, update, delete on table_name to db_ras_poc;</pre><ul><li>Now, we start creating the namespace, attribute and ACL</li></ul><pre>DECLARE<br>  attrlist XS$NS_ATTRIBUTE_LIST;<br>BEGIN<br>  attrlist := XS$NS_ATTRIBUTE_LIST();<br>  attrlist.extend(1);<br>  attrlist(1) := XS$NS_ATTRIBUTE(&#39;deptno&#39;, &#39;0&#39;);<br> <br>  SYS.XS_NAMESPACE.CREATE_TEMPLATE(&#39;POC_NS&#39;,attrlist);<br>END;<br><br>-- create ACL<br>DECLARE<br>  aces xs$ace_list := xs$ace_list();<br>BEGIN<br>  aces.extend(1);<br> <br>  aces(1) := xs$ace_type(privilege_list =&gt; xs$name_list(&#39;select&#39;,&#39;insert&#39;,&#39;update&#39;,&#39;delete&#39;),<br>                         principal_name =&gt; &#39;ras_poc&#39;);<br> <br>  sys.xs_acl.create_acl(name      =&gt; &#39;acl_name&#39;,<br>                    ace_list      =&gt; aces,<br>                    sec_class     =&gt; &#39;sys.dml&#39;);<br> <br>END;</pre><ul><li>We then need to create the data security policy and apply to the needed database tables</li></ul><pre>-- Apply the policy to table<br>begin<br>  sys.xs_data_security.apply_object_policy(<br>    policy =&gt; &#39;policy_name&#39;,<br>    schema =&gt; &#39;schema_name&#39;,<br>    object =&gt;&#39;table_name&#39;);<br>end;</pre><ul><li>The next step is to enable RAS in the APEX environment. We start be <a href="https://docs.oracle.com/en/database/oracle/apex/22.1/aeadm/enabling-real-application-security.html#GUID-87495F74-7FC9-4076-AEFC-FE09DD75D212">enabling RAS from the APEX Administration Services</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a4rY-2Zzw1fTCEY7kK3Iow.png" /><figcaption>Enable RAS in APEX</figcaption></figure><ul><li>Next, we access our APEX workspace and go to the target app.</li><li>Click Shared Components -&gt; Security -&gt; Authentication Schemes -&gt; Oracle APEX Accounts - Current</li><li>Look for the Real Application Security tab and switch the <strong>RAS Mode</strong> to <strong>External Users.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fq_rqdchvDjkZyyPlXMonA.png" /><figcaption>RAS in APEX Application</figcaption></figure><ul><li>You will find the created Dynamic Role ‘RAS_POC’ in the shuttle box on the left. Move it to the right.</li><li>In the below shuttle box, you will find the created Namespace. Move it to the right as well.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ufyEoLw5LBpb_eotClrYVQ.png" /><figcaption>Dynamic Roles &amp; Namespaces in RAS</figcaption></figure><ul><li>The next step is going to the “Source” tab to write our POST_AUTH procedure.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z3mMGicI2zUEocCHawEkBg.png" /><figcaption>POST_AUTH PL/SQL Procedure</figcaption></figure><ul><li>In the “Login Processing” tab, make sure to add the POST_AUTH procedure name, which is the name defined in the source.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pYh_Iyp7WYmA2OjGheO9og.png" /><figcaption>Login Processing</figcaption></figure><ul><li>Click Apply Changes.</li><li>Go to Shared Components -&gt; Security Attributes -&gt; Authorization. This is where we need to define the source for authorization to be the authentication scheme.</li><li>Click Apply Changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9notsY4mbHW1q6RFe5B5cQ.png" /><figcaption>Authorization Source</figcaption></figure><p>That’s it! Now, when you run the application, users access to database tables and objects will be determined by the set RAS policies. We can test the RAS policy by:</p><ol><li>Logging in to the APEX app as a user with the role that you specified in the RAS policy.</li><li>Navigate to the database object that you specified in the RAS policy.</li><li>Verify that you can access the database object.</li><li>Log out and log in as a different user.</li><li>Verify that access to database object changes accordingly.</li></ol><h4>Conclusion</h4><p>Enabling RAS with Oracle APEX on Oracle Database can provide organizations with a more granular way to control access to their database resources. By following the steps outlined in this blog post, you can enable RAS in your APEX applications and better manage security policies for your DB instances and applications.</p><p><em>Co-authored with: </em><a href="https://medium.com/u/d1fa420483d9"><em>Aurelia Nita</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33892967beff" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Can your External Users Authenticate into your APEX Apps?]]></title>
            <link>https://medium.com/@rana.saeed/can-your-external-users-authenticate-into-your-apex-apps-606e48f9417b?source=rss-a47390ed79f6------2</link>
            <guid isPermaLink="false">https://medium.com/p/606e48f9417b</guid>
            <category><![CDATA[apex]]></category>
            <category><![CDATA[low-code]]></category>
            <category><![CDATA[oracle-cloud]]></category>
            <category><![CDATA[authentication]]></category>
            <dc:creator><![CDATA[Rana Saeed]]></dc:creator>
            <pubDate>Thu, 16 Mar 2023 11:27:16 GMT</pubDate>
            <atom:updated>2023-03-16T11:27:16.176Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/688/1*dus7k8kew3lNPJ6hyLhKhQ.png" /></figure><p><a href="https://apex.oracle.com/en/">Oracle APEX</a> has been on the forefront of Low-code development, and for good reasons. One of which being the ability to integrate with external services. In this article, we want to focus more on integrating with external Authentication schemes; specifically Azure Active Directory.</p><p>But first things first, how does authentication work in APEX? One of the fundamental components we think about when we develop our apps is how are users going to be authenticated into the app? APEX handles this by offering a wide array of pre-configured <a href="https://docs.oracle.com/en/database/oracle/apex/22.2/htmdb/preconfigured-authentication-schemes.html#GUID-CD382D4A-AC00-4185-B37F-9A5BC9417A7B">authentication schemes</a>. These schemes are handling the security and session management aspects of the login process by default. The offered schemes include Oracle APEX accounts and Database accounts for login. They also support SSO, SAML and LDAP directories. Social Sign In with Google, Facebook is also supported, along with any network supporting OpenID Connect or OAuth2 protocols.</p><p>The process of enabling an authentication scheme is quite straightforward. We simply log in into our APEX development environment, select our application, go to its shared components\authentication schemes and choose our preferred authentication method and make sure to apply it as the current scheme to the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WGIDEQa8gw5M2cNRrZX2mw.png" /><figcaption>Authentication Schemes</figcaption></figure><p>In this article, I will provide a guide on how to use Azure Active Directory for authentication with APEX.</p><h4>Connecting on Azure AD:</h4><ul><li>First, we need to register our APEX application in Azure AD. After opening Azure → Azure Active Directory, Go to App Registrations.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b7PekB6OTSV-AhrYlKwfeA.png" /></figure><ul><li>Click on New Registration and Enter a name for your application. We then Add the Redirect URI. This is your APEX application’s base URL with “apex_authentication.callback” extension. Then Click Register.The URI should look like this:</li></ul><p><em>https://exampleADB.eu-frankfurt-1.oraclecloudapps.com/ords/apex_authentication.callback</em></p><ul><li>Next, we need to add an application ID by clicking on Add an Application ID URI. After setting the ID, we will keep record of it to use later in our APEX app.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-veV0VXieoeUQRd4wtjQ_Q.png" /></figure><ul><li>Now we need to grant access to the users who will be using the APEX application. We start by accessing the Enterprise Applications. Select the application we just created. Go to Users and Groups.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/765/1*MCaH9147kXyDJyk7J94gXA.png" /></figure><ul><li>Click on Add User and start adding the AD users we will want to access our APEX application. We then click Assign.</li></ul><h4>Creating Web Credentials on Oracle APEX:</h4><p>Now we are ready to move on to the APEX configuration.</p><ul><li>We start by logging in to our App’s workspace and selecting the application. We go to the Workspace Objects to create our Web Credentials.</li><li>We click on New Credentials and start filling out the information. We add the Client ID, which we can retrieve from our app registration in Active Directory.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qewq4B-BU6dUiPIbOuMarw.png" /></figure><ul><li>Next, we create the App secret in Active Directory by clicking on Certificates &amp; Secrets. Create a New Secret, give it a name and click Add. We then take note of the value of the created key and add it to the APEX credentials and click Create.</li></ul><h4>Creating an Authentication Shceme on Oracle APEX:</h4><ul><li>Now we need to define our new Authentication Scheme. We access the Authentication Schemes from the Shared Components in our APEX app.</li><li>Create a New Authentication Scheme, and select the Schema Type to be “Social Sign In”.</li><li>Add Discovery URL, which can be found in Active Directory → Overview → Endpoints → OpenID Connect metadata document.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jzOK5XT9IWBaMlOMqQJouA.png" /></figure><ul><li>Then add the Scope of access you need for your application. These are the <a href="https://openid.net/specs/openid-connect-basic-1_0.html#Scopes">permissions supported by OpenID </a>that the application will ask the user for such as profile, email, phone etc.</li><li>Finally, add the Username Attribute with which your users will log in with (email, preferred_username, etc…) and Click Create Authentication Scheme. Make sure the newly created scheme is the current one.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WOk0Slpf_HPms8x3tE7UoA.png" /></figure><p>And that’s it! We have now enabled our APEX login to be routed to Azure AD. Once the user successfuly completes the login process, they are routed back to our APEX app with access.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=606e48f9417b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>