<?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 Ahmed Samir on Medium]]></title>
        <description><![CDATA[Stories by Ahmed Samir on Medium]]></description>
        <link>https://medium.com/@a7med_samir?source=rss-0eb935413b3e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Ahmed Samir on Medium</title>
            <link>https://medium.com/@a7med_samir?source=rss-0eb935413b3e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 03:11:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@a7med_samir/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[Connecting Oracle Integration to Oracle Fusion Using JWT User Assertion]]></title>
            <link>https://medium.com/@a7med_samir/connecting-oracle-integration-to-oracle-fusion-using-jwt-user-assertion-2b3f63960b35?source=rss-0eb935413b3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b3f63960b35</guid>
            <category><![CDATA[oauth2]]></category>
            <category><![CDATA[oracle-fusion]]></category>
            <category><![CDATA[oracle-integration-cloud]]></category>
            <category><![CDATA[cloud-integration]]></category>
            <category><![CDATA[jwt]]></category>
            <dc:creator><![CDATA[Ahmed Samir]]></dc:creator>
            <pubDate>Tue, 01 Dec 2026 12:10:45 GMT</pubDate>
            <atom:updated>2026-12-01T12:10:45.679Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A practical walkthrough of the integration user, IAM application, signing certificate, and OIC connection configuration.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uz72Ad1w2CKHMcbgv9zCgQ.jpeg" /><figcaption><em>OIC generates signed assertions, IAM validates the token request and issues an access token, and Fusion authorizes the API call under the integration user’s identity.</em></figcaption></figure><p>I recently completed an Oracle Integration Cloud (OIC) connection to Oracle Fusion using <strong>OAuth with JWT User Assertion</strong>.</p><p>This article walks through the configuration, explains the purpose of each identity and certificate, and highlights a detail that deserves particular attention: the difference between the JWT header’s kid and the payload’s sub.</p><p>The approach uses a dedicated integration account and signed assertions to request access tokens without supplying that user’s password during token acquisition. Oracle documents JWT User Assertion as a supported approach for accessing Fusion REST resources on behalf of a user.</p><p>Implementation details:<br>Oracle Integration version: OIC 3<br>Fusion release: 26D<br>Adapter: REST Adapter</p><p><em>All names and configuration examples below are illustrative.</em></p><h3>How the flow works</h3><p>The exchange has four main steps:</p><ol><li>OIC signs a JWT user assertion using its private signing key.</li><li>OIC sends a token request to the Fusion-associated IAM identity domain.</li><li>IAM validates the request and issues an access token representing the integration user.</li><li>OIC presents that access token when calling Fusion.</li></ol><p>The integration user’s Fusion roles and data access still determine what the integration can do. A successful token request does not establish authorization for every business operation.</p><h3>Understand the identities before configuring anything</h3><p>Several configuration values appear together, but each serves a different purpose.</p><pre><strong>Value</strong>                   | <strong>Purpose</strong><br>------------------------|-----------------------------------------------------------------<br>Integration username    | Identifies the Fusion user represented by the user assertion<br>OAuth Client ID         | Identifies the registered confidential application<br>IAM certificate alias   | Identifies the certificate used to validate the assertion signature<br>OIC private key alias   | Identifies the private signing key stored in OIC</pre><p>For the examples in this article, I’ll use:</p><pre>Integration username: <strong>oic.hcm.integration</strong><br>IAM certificate alias: <strong>OIC_TEST_FUSION_JWT</strong><br>OIC private key alias: <strong>OIC_TEST_FUSION_JWT</strong></pre><p><em>The two aliases belong to separate systems. Using the same name makes the configuration easier to follow.</em></p><p>Also distinguish a <strong>user assertion</strong> from a <strong>client assertion</strong>. The former identifies the user being represented; the latter authenticates the OAuth client when certificate-based client authentication is used. <a href="https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/ClientAssertion.htm">Oracle IAM assertion reference</a></p><h3>Step 1: Prepare the Fusion integration account</h3><p>Create or reuse a dedicated integration account.</p><p>Assign the roles and data access required for the intended operation, and confirm that the corresponding user is available in the Fusion-associated identity domain.</p><p>Record the exact username. You will use it in the user assertion’s sub claim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eYoiv6phW0hTaR6Jfcd9xg.png" /><figcaption>Integration account and relevant role assignments.</figcaption></figure><h3>Step 2: Generate the signing key and certificate</h3><p>Use your organization’s approved certificate process.</p><p>For a setup that permits a self-signed certificate, the following OpenSSL example creates an encrypted private key and a matching public certificate:</p><pre>openssl req -x509 -newkey rsa:2048 -sha256 \<br>  -keyout oic_test_jwt_private.pem \<br>  -out oic_test_jwt_public.crt \<br>  -days 365 \<br>  -subj &quot;/CN=OIC-Test-Fusion-JWT&quot;</pre><p>Use fresh filenames and retain the private-key password securely.</p><p>The files have different destinations:</p><pre><strong>File</strong>                        | <strong>Destination</strong><br>----------------------------|----------------------------------<br>oic_test_jwt_private.pem    | OIC private signing-key store<br>oic_test_jwt_public.crt     | IAM certificate configuration</pre><p>Keep the private key protected throughout this process. Also, please ensure that the passphrase is readily available, as it will be required during the OIC configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*BDBWNs52188OCT1qUblNyg.png" /><figcaption>Certificate subject and validity dates.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/284/1*OEwvwTtlZrxQ1z_ouyc71A.png" /><figcaption>Generated files.</figcaption></figure><h3>Step 3: Configure the IAM confidential application</h3><p>In the identity domain associated with the target Fusion environment:</p><ol><li>Open <strong>Integrated applications</strong>.</li><li>Create a <strong>Confidential Application</strong>.</li><li>Enable OAuth client configuration.</li><li>Enable the <strong>JWT assertion</strong> grant.</li><li>Select the <strong>Trusted</strong> client type.</li><li>Import the public signing certificate.</li><li>Add the exact scope for the target Fusion resource.</li><li>Save and activate the application.</li></ol><p>Record the generated Client ID.</p><p>Find the scope in the provisioned Fusion resource application’s OAuth configuration. Use the value for your environment. <a href="https://docs.oracle.com/en/cloud/saas/applications-common/26d/oaext/configure-oauth.html">Oracle Fusion application and scope configuration</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*C9J6ij8qsmW8tECdaXHD9w.png" /><figcaption>Application grant.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y4chdSHJwa9imhjJpG2KYQ.png" /><figcaption>Client Type</figcaption></figure><p>Imoprt the public certificate that was generated in Step 2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m0k91r3i24itAS0G5hFbVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-MQeDD9L4rd_Nj8jXqj0PQ.png" /><figcaption>Signing certificate alias.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*djmiqS7eABFAf6eIMDPj-A.png" /><figcaption>Authorized Fusion scope.</figcaption></figure><h3>Step 4: Upload the private signing key into OIC</h3><p>In Oracle Integration:</p><ol><li>Open <strong>Settings → Certificates</strong>.</li><li>Select <strong>Upload</strong>.</li><li>Enter the alias OIC_TEST_FUSION_JWT.</li><li>Select <strong>Signing key</strong>, then <strong>Private</strong>.</li><li>Upload the private-key file.</li><li>Enter its password (Pass phrase) when prompted.</li><li>Complete the upload.</li></ol><p>Oracle documents PKCS#1 and PKCS#8 as supported signing-key formats. <a href="https://docs.oracle.com/en/cloud/paas/application-integration/integrations-user/manage-security-certificates.html">OIC certificate management</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xxoQPm-Xu7hOpESUVeL1vQ.png" /><figcaption>OIC Test Environment.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/998/1*jlhddreJbEESSjjq72IF5Q.png" /><figcaption>Upload the private key.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1kivqX5YDivKC2CW2dWJog.png" /><figcaption>After uploading</figcaption></figure><h3>Step 5: Prepare the JWT header and payload</h3><p>Create two JSON files for the connection.</p><h3>JWT header</h3><pre>{<br>  &quot;alg&quot;: &quot;RS256&quot;,<br>  &quot;typ&quot;: &quot;JWT&quot;,<br>  &quot;kid&quot;: &quot;OIC_TEST_FUSION_JWT&quot;<br>}</pre><p>The kid identifies the certificate used to verify the signature. Match it to the configured IAM certificate alias. <a href="https://docs.oracle.com/en/cloud/paas/application-integration/utilities-adapters/using-oauth-2_0-grants-oracle-identity-domain-environments.html">Oracle JWT prerequisites</a></p><h3>JWT user payload</h3><pre>{<br>  &quot;iss&quot;: &quot;&lt;CLIENT_ID&gt;&quot;,<br>  &quot;sub&quot;: &quot;oic.hcm.integration&quot;,<br>  &quot;aud&quot;: &quot;https://identity.oraclecloud.com/&quot;,<br>  &quot;exp&quot;: 0,<br>  &quot;iat&quot;: 0,<br>  &quot;jti&quot;: &quot;generated-at-runtime&quot;<br>}</pre><p>Replace &lt;CLIENT_ID&gt; before uploading the file.</p><p>In this example:</p><ul><li>iss identifies the confidential application.</li><li>sub identifies the integration user.</li><li>aud identifies the intended assertion validator.</li></ul><p>The audience shown follows Oracle’s ERP adapter example. That guide also states that OIC dynamically calculates exp, iat, nbf, and jti when present. The zeros above are template values for that adapter behavior; they are unsuitable for a manually signed assertion. <a href="https://docs.oracle.com/en/cloud/paas/application-integration/erp-adapter/jwt-user-assertions.html">Oracle outbound JWT configuration</a></p><p>Oracle’s generic IAM reference describes the domain URL as an audience. In this example, using https://identity.oraclecloud.com/ as the audience (aud) value has been successfully tested and works as expected. Check the guidance for your exact adapter and domain configuration before choosing this value. <a href="https://docs.oracle.com/en-us/iaas/Content/Identity/api-getstarted/ClientAssertion.htm">Oracle IAM assertion claims</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/310/1*j9KR1wvcKVtlJQd9S4c1-g.png" /><figcaption>JSON files after creation.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7ObxtzhCXGAMKuuzA_zwNw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5lwJ4ewGAxOI1kkZJe9PUg.png" /></figure><h3>Step 6: Configure the OIC connection</h3><p>Create the appropriate Fusion adapter invoke connection and select <strong>OAuth using JWT User Assertion</strong>.</p><p>Configure these fields:</p><pre><strong>Field</strong>                 | <strong>Value</strong><br>----------------------|---------------------------------------------------<br>Adapter Type          | REST<br>Fusion host           | Target Fusion environment<br>Access token URI      | https://&lt;IDENTITY_DOMAIN_HOST&gt;/oauth2/v1/token<br>JWT headers           | Header JSON file<br>JWT payload.          | Payload JSON file<br>JWT private key alias | OIC_TEST_FUSION_JWT<br>Scope                 | Exact authorized Fusion resource scope</pre><p>The private key alias must match the signing-key entry uploaded into OIC. Record any custom access-token request configuration so the setup is reproducible. <a href="https://docs.oracle.com/en/cloud/paas/application-integration/erp-adapter/create-connection.html">Oracle adapter connection configuration</a></p><p>Save and test the connection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1WFDkwxvO7xuL19NcDx6Kg.png" /><figcaption>OIC connection security configuration.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e6FmrHkw-kUsLMTZaLpTuQ.png" /><figcaption>Successful connection test.</figcaption></figure><h3>How to get Identity Domain Host</h3><p>Navigate to the OCI IAM Identity Domain associated with the target Oracle Fusion environment, where the confidential application was created, and make a note of the <strong>Domain URL</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*QGeRamNGJno9XzKOLKwHjg.png" /></figure><h3>A configuration detail worth checking: kid versus sub</h3><p>These fields answer different questions:</p><pre><strong>kid</strong> → Which certificate should validate the signature?<br><strong>sub</strong> → Which user is the assertion representing?</pre><p>For this example, the mapping is:</p><pre>JWT header kid:  <strong>OIC_TEST_FUSION_JWT</strong><br>JWT payload sub: <strong>oic.hcm.integration</strong></pre><p>Putting the integration username into kid can cause a certificate lookup mismatch.</p><p>When investigating an invalid_client error, check the certificate alias, corresponding private key, Client ID, application status, and token endpoint. The error message alone does not establish which setting is wrong.</p><h3>Step 7: Validate the actual integration operation</h3><p>After the connection test, run a small, permitted operation against Fusion.</p><p>Record the operation tested, whether it returned the expected result, and whether the integration account had the intended data access. OIC connection testing and business-operation testing establish different things.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Au_a3Vw9Z8-o6f_e9vkidg.png" /><figcaption>Sample Sanitized Integration</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5GpdXscA07FFsUdY6M2gkg.png" /><figcaption>JWT User Assertion connection resource URI for workers.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6t7cQm9RbKfAjoq_tq9hPQ.png" /><figcaption>Integration run result.</figcaption></figure><p>For operational readiness, also verify unattended execution across token expiry and establish ownership for certificate renewal.</p><h3>What I would emphasize to anyone implementing this</h3><p>Write down the identity and key mappings before configuring the connection.</p><p>The username, Client ID, certificate alias, private key alias, scope, and audience each have a specific role. Keeping those mappings explicit makes both implementation and troubleshooting easier.</p><p>My JWT User Assertion setup is now working. The next step is to document the validated operation and certificate lifecycle alongside the configuration so the integration remains maintainable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b3f63960b35" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Oracle Integrations Cloud MCP Server]]></title>
            <link>https://medium.com/@a7med_samir/oracle-integrations-cloud-mcp-server-b10b0d1c3bb6?source=rss-0eb935413b3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/b10b0d1c3bb6</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[oic]]></category>
            <category><![CDATA[mcp-server]]></category>
            <category><![CDATA[cline]]></category>
            <dc:creator><![CDATA[Ahmed Samir]]></dc:creator>
            <pubDate>Tue, 05 Aug 2025 20:20:03 GMT</pubDate>
            <atom:updated>2025-08-05T20:20:03.531Z</atom:updated>
            <content:encoded><![CDATA[<p>Want live operational health, programmatic querying, and integration analytics for your Oracle Integration Cloud (OIC) environment — right from your favorite AI assistant panel or script?</p><p>With the Model Context Protocol (MCP) and the Cline tool, you can expose production-grade insight and automation into your OIC platform.</p><p>Below, you’ll learn how to deploy, configure, and use a Python MCP server for OIC monitoring with fully automated OAuth2 authentication.</p><p>✨ <strong>Overview: What Is This and Why Use It?</strong></p><p>This Python MCP server brings OIC’s key runtime and monitoring APIs to your fingertips in any MCP-compatible environment (including VSCode extensions and large language models).</p><p>It lets you:</p><ul><li>View live aggregated message status for all integrations.</li><li>Get per-integration metrics, digests, and error breakdowns.</li><li>List, inspect, and resubmit failed integration instances.</li><li>Operate with secure, renewable OAuth2 tokens.</li></ul><p>📈 <strong>Architectural Flow:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*2PCTHtHLKxxwr3984HfkfQ.png" /></figure><p>🛠️ <strong>Features (Tools)</strong> :</p><ul><li><strong>runtime_summary_retrieval</strong><br> Get instantly the total, succeeded, errored, and aborted messages for your OIC instance.</li><li><strong>get_integration_message_metrics</strong><br> Query individual integrations for granular activity, error, and performance metrics.</li><li><strong>get_errored_instances</strong><br> See all failed recent runs — prioritized for rapid triage.</li><li><strong>resubmit_errored_integration</strong><br> Retry a failed integration with one click or programmatic call.</li><li><strong>get_all_integrations</strong><br> Inventory all active integrations, with scheduled status.</li></ul><p>⚡ <strong>Quickstart Guide</strong>:</p><p><strong>1. Clone or Download</strong></p><p>Place the following code (oic_mcp_server.py) and its dependencies in a project folder.</p><pre>import asyncio<br>import json<br>import logging<br>import os<br>from typing import Sequence<br>import requests<br><br>from mcp.server import Server, NotificationOptions<br>from mcp.server.models import InitializationOptions<br>from mcp.types import (<br>    Resource,<br>    Tool,<br>)<br>import mcp.types as types<br><br># Configure logging<br>logging.basicConfig(level=logging.INFO)<br>logger = logging.getLogger(&quot;oic-mcp-server&quot;)<br><br># OIC Configuration - Read from environment variables with fallback defaults<br>OIC_BASE_URL = os.getenv(&quot;OIC_BASE_URL&quot;, &quot;https://xxx.ocp.oraclecloud.com&quot;)<br>OIC_INSTANCE = os.getenv(&quot;OIC_INSTANCE&quot;, &quot;integration Instance Part of Design time url&quot;)<br><br># Log configuration on startup<br>logger.info(f&quot;OIC Configuration:&quot;)<br>logger.info(f&quot;  Base URL: {OIC_BASE_URL}&quot;)<br>logger.info(f&quot;  Instance: {OIC_INSTANCE}&quot;)<br><br># Create MCP server instance<br>server = Server(&quot;oic-monitoring-server&quot;)<br><br>def get_auth_token() -&gt; str:<br>    token_url = os.getenv(&quot;OIC_OAUTH_TOKEN_URL&quot;, &quot;&quot;)<br>    client_id = os.getenv(&quot;OIC_CLIENT_ID&quot;, &quot;&quot;)<br>    client_secret = os.getenv(&quot;OIC_CLIENT_SECRET&quot;, &quot;&quot;)<br>    scope = os.getenv(&quot;OIC_SCOPE&quot;, &quot;&quot;)<br><br>    data = {<br>        &quot;grant_type&quot;: &quot;client_credentials&quot;,<br>        &quot;client_id&quot;: client_id,<br>        &quot;client_secret&quot;: client_secret,<br>    }<br>    if scope:<br>        data[&quot;scope&quot;] = scope<br><br>    resp = requests.post(token_url, data=data)<br>    resp.raise_for_status()<br>    return resp.json()[&quot;access_token&quot;]<br><br>def make_oic_request(endpoint: str, params: dict | None = None) -&gt; dict:<br>    &quot;&quot;&quot;Make authenticated request to OIC API&quot;&quot;&quot;<br>    try:<br>        token = get_auth_token()<br>        url = f&quot;{OIC_BASE_URL}{endpoint}&quot;<br>        <br>        headers = {<br>            &quot;Authorization&quot;: f&quot;Bearer {token}&quot;,<br>            &quot;Accept&quot;: &quot;application/json&quot;<br>        }<br>        <br>        if params:<br>            url += &quot;?&quot; + &quot;&amp;&quot;.join([f&quot;{k}={v}&quot; for k, v in params.items()])<br>        <br>        logger.info(f&quot;Making request to: {url}&quot;)<br>        response = requests.get(url, headers=headers)<br>        <br>        if 200 &lt;= response.status_code &lt; 300:<br>            return response.json()<br>        else:<br>            logger.error(f&quot;OIC API request failed with status {response.status_code}: {response.text}&quot;)<br>            return {&quot;error&quot;: f&quot;Failed to call OIC API with status code {response.status_code}&quot;}<br>            <br>    except Exception as e:<br>        logger.error(f&quot;Error making OIC request: {e}&quot;)<br>        return {&quot;error&quot;: f&quot;Request failed: {str(e)}&quot;}<br><br>@server.list_tools()<br>async def handle_list_tools() -&gt; list[Tool]:<br>    &quot;&quot;&quot;List available OIC monitoring tools&quot;&quot;&quot;<br>    return [<br>        Tool(<br>            name=&quot;runtime_summary_retrieval&quot;,<br>            description=&quot;Retrieve the summary of all integration messages by viewing aggregated counts of total, processed, succeeded, errored, and aborted messages. This gives a quick health snapshot of your OIC environment.&quot;,<br>            inputSchema={<br>                &quot;type&quot;: &quot;object&quot;,<br>                &quot;properties&quot;: {},<br>                &quot;required&quot;: []<br>            },<br>        ),<br>        Tool(<br>            name=&quot;get_integration_message_metrics&quot;,<br>            description=&quot;Retrieve message metrics for a given integration and time window by viewing aggregated counts of total, processed, succeeded, errored, and aborted messages. This allows you to quickly identify which integrations are generating errors or bottlenecks.&quot;,<br>            inputSchema={<br>                &quot;type&quot;: &quot;object&quot;,<br>                &quot;properties&quot;: {<br>                    &quot;integration_name&quot;: {<br>                        &quot;type&quot;: &quot;string&quot;,<br>                        &quot;description&quot;: &quot;Name of the integration to get metrics for&quot;<br>                    },<br>                    &quot;timewindow&quot;: {<br>                        &quot;type&quot;: &quot;string&quot;, <br>                        &quot;description&quot;: &quot;Time window for metrics (1h, 6h, 1d, 2d, 3d, RETENTIONPERIOD)&quot;,<br>                        &quot;default&quot;: &quot;1h&quot;<br>                    }<br>                },<br>                &quot;required&quot;: [&quot;integration_name&quot;, &quot;timewindow&quot;]<br>            },<br>        ),<br>        Tool(<br>            name=&quot;get_errored_instances&quot;,<br>            description=&quot;Find all recently errored integration instances and prioritize them based on the latest update time. Results are ordered by last updated time, making it easy to prioritize the most recent or urgent failures.&quot;,<br>            inputSchema={<br>                &quot;type&quot;: &quot;object&quot;,<br>                &quot;properties&quot;: {<br>                    &quot;timewindow&quot;: {<br>                        &quot;type&quot;: &quot;string&quot;,<br>                        &quot;description&quot;: &quot;Time window for error instances (1h, 6h, 1d, 2d, 3d, RETENTIONPERIOD)&quot;,<br>                        &quot;default&quot;: &quot;1h&quot;<br>                    }<br>                },<br>                &quot;required&quot;: [&quot;timewindow&quot;]<br>            },<br>        ),<br>        Tool(<br>            name=&quot;resubmit_errored_integration&quot;,<br>            description=&quot;Automatically resubmit a failed integration instance by providing its unique identifier, helping you recover from errors quickly.&quot;,<br>            inputSchema={<br>                &quot;type&quot;: &quot;object&quot;,<br>                &quot;properties&quot;: {<br>                    &quot;instanceId&quot;: {<br>                        &quot;type&quot;: &quot;string&quot;,<br>                        &quot;description&quot;: &quot;Unique identifier of the errored integration instance to resubmit&quot;<br>                    }<br>                },<br>                &quot;required&quot;: [&quot;instanceId&quot;]<br>            },<br>        ),<br>        Tool(<br>            name=&quot;get_all_integrations&quot;,<br>            description=&quot;Retrieves information about all integrations ordered by the last updated time.&quot;,<br>            inputSchema={<br>                &quot;type&quot;: &quot;object&quot;,<br>                &quot;properties&quot;: {},<br>                &quot;required&quot;: []<br>            },<br>        ),<br>    ]<br><br>@server.call_tool()<br>async def handle_call_tool(name: str, arguments: dict | None) -&gt; Sequence[types.TextContent | types.ImageContent | types.EmbeddedResource]:<br>    &quot;&quot;&quot;Handle tool execution requests&quot;&quot;&quot;<br>    <br>    if name == &quot;runtime_summary_retrieval&quot;:<br>        return await runtime_summary_retrieval()<br>    <br>    elif name == &quot;get_integration_message_metrics&quot;:<br>        if not arguments or &quot;integration_name&quot; not in arguments or &quot;timewindow&quot; not in arguments:<br>            raise ValueError(&quot;integration_name and timewindow parameters are required&quot;)<br>        return await get_integration_message_metrics(<br>            arguments[&quot;integration_name&quot;], <br>            arguments[&quot;timewindow&quot;]<br>        )<br>    <br>    elif name == &quot;get_errored_instances&quot;:<br>        if not arguments or &quot;timewindow&quot; not in arguments:<br>            raise ValueError(&quot;timewindow parameter is required&quot;)<br>        return await get_errored_instances(arguments[&quot;timewindow&quot;])<br>    <br>    elif name == &quot;resubmit_errored_integration&quot;:<br>        if not arguments or &quot;instanceId&quot; not in arguments:<br>            raise ValueError(&quot;instanceId parameter is required&quot;)<br>        return await resubmit_errored_integration(arguments[&quot;instanceId&quot;])<br>    <br>    elif name == &quot;get_all_integrations&quot;:<br>        return await get_all_integrations()<br>    <br>    else:<br>        raise ValueError(f&quot;Unknown tool: {name}&quot;)<br><br>async def runtime_summary_retrieval() -&gt; Sequence[types.TextContent]:<br>    &quot;&quot;&quot;Retrieve the summary of all integration messages&quot;&quot;&quot;<br>    try:<br>        endpoint = &quot;/ic/api/integration/v1/monitoring/integrations/messages/summary&quot;<br>        params = {&quot;integrationInstance&quot;: OIC_INSTANCE}<br>        <br>        result = make_oic_request(endpoint, params)<br>        <br>        if &quot;error&quot; in result:<br>            return [types.TextContent(type=&quot;text&quot;, text=json.dumps(result))]<br>        <br>        message_summary = result.get(&#39;messageSummary&#39;, result)<br>        return [types.TextContent(type=&quot;text&quot;, text=json.dumps(message_summary, indent=2))]<br>        <br>    except Exception as e:<br>        logger.error(f&quot;Error in runtime_summary_retrieval: {e}&quot;)<br>        return [types.TextContent(type=&quot;text&quot;, text=f&quot;Error retrieving runtime summary: {str(e)}&quot;)]<br><br>async def get_integration_message_metrics(integration_name: str, timewindow: str) -&gt; Sequence[types.TextContent]:<br>    &quot;&quot;&quot;Retrieve message metrics for given integration and time window&quot;&quot;&quot;<br>    try:<br>        endpoint = &quot;/ic/api/integration/v1/monitoring/integrations&quot;<br>        q_parameter = f&quot;{{name:&#39;{integration_name}&#39;,timewindow:&#39;{timewindow}&#39;}}&quot;<br>        params = {<br>            &quot;integrationInstance&quot;: OIC_INSTANCE,<br>            &quot;q&quot;: q_parameter<br>        }<br>        <br>        result = make_oic_request(endpoint, params)<br>        <br>        if &quot;error&quot; in result:<br>            return [types.TextContent(type=&quot;text&quot;, text=json.dumps(result))]<br>        <br>        if &quot;items&quot; in result:<br>            integration_details = []<br>            for item in result[&quot;items&quot;]:<br>                detail = {<br>                    &quot;name&quot;: item.get(&#39;name&#39;),<br>                    &quot;version&quot;: item.get(&#39;version&#39;),<br>                    &quot;noOfAborted&quot;: item.get(&#39;noOfAborted&#39;),<br>                    &quot;noOfErrors&quot;: item.get(&#39;noOfErrors&#39;),<br>                    &quot;noOfMsgsProcessed&quot;: item.get(&#39;noOfMsgsProcessed&#39;),<br>                    &quot;noOfMsgsReceived&quot;: item.get(&#39;noOfMsgsReceived&#39;),<br>                    &quot;noOfSuccess&quot;: item.get(&#39;noOfSuccess&#39;),<br>                    &quot;scheduleApplicable&quot;: item.get(&#39;scheduleApplicable&#39;),<br>                    &quot;scheduleDefined&quot;: item.get(&#39;scheduleDefined&#39;)<br>                }<br>                integration_details.append(detail)<br>            <br>            return [types.TextContent(type=&quot;text&quot;, text=json.dumps(integration_details, indent=2))]<br>        else:<br>            return [types.TextContent(type=&quot;text&quot;, text=json.dumps(result, indent=2))]<br>        <br>    except Exception as e:<br>        logger.error(f&quot;Error in get_integration_message_metrics: {e}&quot;)<br>        return [types.TextContent(type=&quot;text&quot;, text=f&quot;Error retrieving integration message metrics: {str(e)}&quot;)]<br><br>async def get_errored_instances(timewindow: str) -&gt; Sequence[types.TextContent]:<br>    &quot;&quot;&quot;Find all recently errored integration instances&quot;&quot;&quot;<br>    try:<br>        endpoint = &quot;/ic/api/integration/v1/monitoring/errors&quot;<br>        q_parameter = f&quot;{{timewindow:&#39;{timewindow}&#39;}}&quot;<br>        params = {<br>            &quot;integrationInstance&quot;: OIC_INSTANCE,<br>            &quot;q&quot;: q_parameter,<br>            &quot;limit&quot;: &quot;5&quot;<br>        }<br>        <br>        result = make_oic_request(endpoint, params)<br>        <br>        if &quot;error&quot; in result:<br>            return [types.TextContent(type=&quot;text&quot;, text=json.dumps(result))]<br>        <br>        if &quot;items&quot; in result:<br>            error_integration_details = []<br>            for item in result[&quot;items&quot;]:<br>                detail = {<br>                    &quot;instanceId&quot;: item.get(&#39;instanceId&#39;),<br>                    &quot;primaryValue&quot;: item.get(&#39;primaryValue&#39;),<br>                    &quot;recoverable&quot;: item.get(&#39;recoverable&#39;),<br>                    &quot;errorCode&quot;: item.get(&#39;errorCode&#39;),<br>                    &quot;errorDetails&quot;: item.get(&#39;errorDetails&#39;)<br>                }<br>                error_integration_details.append(detail)<br>            <br>            return [types.TextContent(type=&quot;text&quot;, text=json.dumps(error_integration_details, indent=2))]<br>        else:<br>            return [types.TextContent(type=&quot;text&quot;, text=json.dumps(result, indent=2))]<br>        <br>    except Exception as e:<br>        logger.error(f&quot;Error in get_errored_instances: {e}&quot;)<br>        return [types.TextContent(type=&quot;text&quot;, text=f&quot;Error retrieving errored instances: {str(e)}&quot;)]<br><br>async def resubmit_errored_integration(instance_id: str) -&gt; Sequence[types.TextContent]:<br>    &quot;&quot;&quot;Resubmit a failed integration instance&quot;&quot;&quot;<br>    try:<br>        token = get_auth_token()<br>        <br>        # You&#39;ll need to replace this with the actual OIC resubmit endpoint<br>        endpoint = f&quot;/ic/api/integration/v1/monitoring/integrations/{instance_id}/resubmit&quot;<br>        url = f&quot;{OIC_BASE_URL}{endpoint}?integrationInstance={OIC_INSTANCE}&quot;<br>        <br>        headers = {<br>            &quot;Authorization&quot;: f&quot;Bearer {token}&quot;,<br>            &quot;Accept&quot;: &quot;application/json&quot;,<br>            &quot;Content-Type&quot;: &quot;application/json&quot;<br>        }<br>        <br>        logger.info(f&quot;Resubmitting integration instance: {instance_id}&quot;)<br>        response = requests.post(url, headers=headers)<br>        <br>        if 200 &lt;= response.status_code &lt; 300:<br>            return [types.TextContent(type=&quot;text&quot;, text=&quot;Your resubmission request was processed successfully.&quot;)]<br>        else:<br>            error_msg = f&quot;Failed to resubmit integration with status code {response.status_code}: {response.text}&quot;<br>            logger.error(error_msg)<br>            return [types.TextContent(type=&quot;text&quot;, text=error_msg)]<br>        <br>    except Exception as e:<br>        logger.error(f&quot;Error in resubmit_errored_integration: {e}&quot;)<br>        return [types.TextContent(type=&quot;text&quot;, text=f&quot;Error resubmitting integration: {str(e)}&quot;)]<br><br>async def get_all_integrations() -&gt; Sequence[types.TextContent]:<br>    &quot;&quot;&quot;Retrieves information about all integrations ordered by the last updated time&quot;&quot;&quot;<br>    try:<br>        # Use exact same format as terminal test that returned 57 integrations<br>        token = get_auth_token()<br>        url = f&quot;{OIC_BASE_URL}/ic/api/integration/v1/monitoring/integrations?integrationInstance={OIC_INSTANCE}&amp;timewindow=RETENTIONPERIOD&quot;<br>        <br>        headers = {<br>            &quot;Authorization&quot;: f&quot;Bearer {token}&quot;,<br>            &quot;Accept&quot;: &quot;application/json&quot;<br>        }<br>        <br>        logger.info(f&quot;Making direct request to: {url}&quot;)<br>        response = requests.get(url, headers=headers)<br>        <br>        if 200 &lt;= response.status_code &lt; 300:<br>            result = response.json()<br>        else:<br>            result = {&quot;error&quot;: f&quot;Failed to call OIC API with status code {response.status_code}: {response.text}&quot;}<br>        <br>        # Debug: Log what we&#39;re getting<br>        logger.info(f&quot;get_all_integrations API result: {result}&quot;)<br>        <br>        if &quot;error&quot; in result:<br>            return [types.TextContent(type=&quot;text&quot;, text=json.dumps(result))]<br>        <br>        # Debug: Show exactly what we received<br>        debug_info = f&quot;Debug info - API returned: keys={list(result.keys())}, totalResults={result.get(&#39;totalResults&#39;, &#39;N/A&#39;)}, items_count={len(result.get(&#39;items&#39;, []))}&quot;<br>        <br>        if &quot;items&quot; in result:<br>            integration_details = []<br>            for item in result[&quot;items&quot;]:<br>                # Handle case where item might be a string instead of dict<br>                if isinstance(item, dict):<br>                    integration_detail = {<br>                        &quot;name&quot;: item.get(&#39;name&#39;),<br>                        &quot;version&quot;: item.get(&#39;version&#39;),<br>                        &quot;noOfAborted&quot;: item.get(&#39;noOfAborted&#39;),<br>                        &quot;noOfErrors&quot;: item.get(&#39;noOfErrors&#39;),<br>                        &quot;noOfMsgsProcessed&quot;: item.get(&#39;noOfMsgsProcessed&#39;),<br>                        &quot;noOfMsgsReceived&quot;: item.get(&#39;noOfMsgsReceived&#39;),<br>                        &quot;noOfSuccess&quot;: item.get(&#39;noOfSuccess&#39;),<br>                        &quot;scheduleApplicable&quot;: item.get(&#39;scheduleApplicable&#39;),<br>                        &quot;scheduleDefined&quot;: item.get(&#39;scheduleDefined&#39;)<br>                    }<br>                else:<br>                    integration_detail = {&quot;raw_item&quot;: str(item)}<br>                integration_details.append(integration_detail)<br>            <br>            return [types.TextContent(type=&quot;text&quot;, text=json.dumps(integration_details, indent=2))]<br>        else:<br>            return [types.TextContent(type=&quot;text&quot;, text=json.dumps(result, indent=2))]<br>        <br>    except Exception as e:<br>        logger.error(f&quot;Error in get_all_integrations: {e}&quot;)<br>        return [types.TextContent(type=&quot;text&quot;, text=f&quot;Error retrieving integration names: {str(e)}&quot;)]<br><br>@server.list_resources()<br>async def handle_list_resources() -&gt; list[Resource]:<br>    &quot;&quot;&quot;List available resources (none for this server)&quot;&quot;&quot;<br>    return []<br><br>async def main():<br>    &quot;&quot;&quot;Main entry point for the MCP server&quot;&quot;&quot;<br>    # Run the server using stdin/stdout streams<br>    from mcp.server.stdio import stdio_server<br>    <br>    async with stdio_server() as (read_stream, write_stream):<br>        await server.run(<br>            read_stream,<br>            write_stream,<br>            initialization_options=InitializationOptions(<br>                server_name=&quot;oic-monitoring-server&quot;,<br>                server_version=&quot;1.0.0&quot;,<br>                capabilities=server.get_capabilities(<br>                    notification_options=NotificationOptions(),<br>                    experimental_capabilities={}<br>                )<br>            ),<br>        )<br><br>if __name__ == &quot;__main__&quot;:<br>    asyncio.run(main())</pre><p><strong>2. Python Environment</strong></p><pre>python3 -m venv mcp_env<br>source mcp_env/bin/activate<br>pip install requests</pre><p><strong>3. Set Your OIC and OAuth2 Credentials</strong></p><ul><li>Obtain your `OIC_BASE_URL`, `OIC_INSTANCE`, `OIC_OAUTH_TOKEN_URL`, `OIC_CLIENT_ID`, and `OIC_CLIENT_SECRET` from your Oracle Cloud Console where you register your Confidential Application.</li></ul><p>🖥️ <strong>Cline/Claude Dev Configuration</strong>:</p><p>Edit (or add to) the MCP servers section in your settings file:</p><pre>&quot;oic-monitoring&quot;: {<br>  &quot;disabled&quot;: false,<br>  &quot;timeout&quot;: 60,<br>  &quot;type&quot;: &quot;stdio&quot;,<br>  &quot;command&quot;: &quot;/absolute/path/to/your/mcp_env/bin/python&quot;,<br>  &quot;args&quot;: [<br>    &quot;/absolute/path/to/your/oic_mcp_server.py&quot;<br>  ],<br>  &quot;env&quot;: {<br>    &quot;OIC_BASE_URL&quot;: &quot;...&quot;,<br>    &quot;OIC_INSTANCE&quot;: &quot;...&quot;,<br>    &quot;OIC_OAUTH_TOKEN_URL&quot;: &quot;...&quot;,<br>    &quot;OIC_CLIENT_ID&quot;: &quot;...&quot;,<br>    &quot;OIC_CLIENT_SECRET&quot;: &quot;...&quot;,<br>    &quot;OIC_SCOPE&quot;: &quot;...&quot;<br>  }<br>}</pre><ul><li>Use absolute paths, not ~.</li><li>Never commit secrets to version control.</li></ul><p>🧐 <strong>Sample Usage Scenarios</strong>:</p><ul><li>Health dashboards:<br> Instantly surface total, error, and success counts for your OIC environment.</li><li>Operation Scripting:<br> Automate error discovery, rapid triage, and resolution via programmable API calls.</li><li>Integration Inventory:<br> Query, inventory, and group or document all active OIC integrations.</li></ul><p>🔒 <strong>Security Best Practices</strong>:</p><ul><li>Store secrets in a vault, not in source-managed config!</li><li>Regularly rotate client secrets.</li><li>Use least-privilege OAuth2 scopes required for only the APIs you are using.</li></ul><p>Start observing and automating your OIC environment — securely, flexibly, and interactively — with Python, OAuth2, and MCP!</p><p><strong>Demo Screenshots from Cline in VS Code</strong>:</p><ul><li>Cline MCP Servers Configuration File</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHoB2OoQUlscOwa_F_ckiQ.png" /></figure><ul><li>Installed MCP Servers in Cline</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y2P8zIWyaX3frBUIUb79hw.png" /></figure><p>Expand OICMonitoring to see available tools.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ujJMKy7f9W9T1Y8aEcJpQ.png" /></figure><ul><li>Chat with your selected AI LLM:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHEzRQ6GCWA7q4kYJjz9Aw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iMCQnPT-NMXfLEMoV2FgZQ.png" /></figure><ul><li>Choose another tool and let your selected LLM work on the returned data</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QOCEf9_4h_aNu0EXNfiMJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7g4sR9jheeXRLqPNRDK97A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RjFYDWnrZMK5VOK_1hmlfA.png" /><figcaption>Generated HTML Table</figcaption></figure><p><strong>Resourc</strong>es:</p><ul><li>A-Team Chronicles (<a href="https://blogs.oracle.com/ateam/post/getting-started-with-model-context-protocol-concepts-and-code-part-1">https://blogs.oracle.com/ateam/post/getting-started-with-model-context-protocol-concepts-and-code-part-1</a>)</li><li>Oracle Integration Cloud REST API Docs (<a href="https://docs.oracle.com/en/cloud/paas/integration-cloud/rest-api-index.html">https://docs.oracle.com/en/cloud/paas/integration-cloud/rest-api-index.html</a>)</li><li>OAuth2 with Oracle Cloud (<a href="https://docs.oracle.com/en/cloud/paas/integration-cloud/integrations-user/oauth20-authentication.html">https://docs.oracle.com/en/cloud/paas/integration-cloud/integrations-user/oauth20-authentication.html</a>)</li><li>Model Context Protocol (MCP) (<a href="https://github.com/modelcontextprotocol/spec">https://github.com/modelcontextprotocol/spec</a>)</li><li>Cline: AI-Powered IDE Automation (<a href="https://clinedev.com/">https://clinedev.com/</a>)</li></ul><p><em>Happy integrating and observing with OIC, MCP, and Cline!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b10b0d1c3bb6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Oracle APEX — Conditional Navigation Bar]]></title>
            <link>https://medium.com/@a7med_samir/oracle-apex-conditional-navigation-bar-f6650da78d67?source=rss-0eb935413b3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6650da78d67</guid>
            <dc:creator><![CDATA[Ahmed Samir]]></dc:creator>
            <pubDate>Tue, 04 Feb 2025 20:43:00 GMT</pubDate>
            <atom:updated>2025-02-04T20:43:00.462Z</atom:updated>
            <content:encoded><![CDATA[<h3>Oracle APEX — Conditional Navigation Bar Rendering</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UYl_RKLmsrz0NXGM3fPXPg.jpeg" /></figure><p>In some situations you may want to control the display of APEX Application Navigation Bar based on different use cases conditionally.</p><p>In this short blog, I will explain how to control your APEX application navigation bar based on an Application Item value.</p><ol><li>Navigate to application Shared Components -&gt; Application Logic -&gt; Application Items and create a new Application Item “APP_DISP_NAV_BAR”</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RKKimz43LWVKw4etcToAxg.png" /></figure><p>2. Navigate to application Shared Components -&gt; User Interface -&gt; Templates</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYM4fp_s11oD9mgRK8qCUA.png" /></figure><p>3. Search for the “Standard” page Template and create a copy of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yAjqS5x64SZbQKXXqT8MCA.png" /></figure><p>4. Choose your new Template Name and Identifer then press “Copy”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CKjkY_xU1bHYJWp4wDbbcw.png" /></figure><p>5. Open your copied version of the “Standard” page template and modify the header section by adding a display style to the div of “t-Header-branding” .</p><pre>&lt;div class=&quot;t-Header-branding&quot; style=&quot;display: &amp;APP_DISP_NAV_BAR.&quot;&gt;</pre><p>The display of header branding now will be controlled by the APP_DISP_NAV_BAR Application Item that we have created in Step#1.</p><p>Final code will look like the following screenshot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPyc4e3eiRXiC-7Oi0idTg.png" /></figure><p>6. The new template is now ready to be used in the application pages. Make sure to replace the “Standard” page template with the new “Standard Page — Extension” page template wherever required.</p><p><em>Note: In this example, only “Standard” page template has been explained, but you can do the same steps for different types of page templates.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zAmpJ2ThNUs2Miy7ebKemg.png" /></figure><p>7. Finally, adding an application process to set the value of “APP_DISP_NAV_BAR” based on some condition. As an example, I am writing condition to check the CGI environment variable HTTP_HOST that is the value returned by owa_util.get_cgi_env (&#39;HTTP_HOST&#39;)</p><p>This condition is just for demo purposes, however, please make sure to use conditions according to your uses cases and business requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EdUHv1tSRJmpBJU-CO51Og.png" /></figure><p>Code:</p><pre>if owa_util.get_cgi_env (&#39;HTTP_HOST&#39;) = &#39;&lt;xxxxxxxxxxxxxxx&gt;.adb.us-ashburn-1.oraclecloudapps.com&#39; then<br>    apex_util.set_session_state(&#39;APP_DISP_NAV_BAR&#39;, &#39;&#39;);<br>else <br>    apex_util.set_session_state(&#39;APP_DISP_NAV_BAR&#39;, &#39;none&#39;);<br>end if;</pre><p>If you run the page now, you will be able to see the navigation bar as usual.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GfYkjuSb7qwgHeVCOjKrlA.png" /></figure><p>Let us reverse the condition to check how it will be hidden</p><pre>if owa_util.get_cgi_env (&#39;HTTP_HOST&#39;) = &#39;&lt;xxxxxxxxxxxxxxx&gt;.adb.us-ashburn-1.oraclecloudapps.com&#39; then<br>    apex_util.set_session_state(&#39;APP_DISP_NAV_BAR&#39;, &#39;none&#39;);<br>else <br>    apex_util.set_session_state(&#39;APP_DISP_NAV_BAR&#39;, &#39;&#39;);<br>end if;</pre><p>Reload the page to check the result when the condition evaluates to true.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Ad8CNPI5ZPGNXC6MUnqIQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6650da78d67" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APEX Interactive Report — Mandatory Search Filter]]></title>
            <link>https://medium.com/@a7med_samir/apex-interactive-report-mandatory-search-filter-ff1a10d4fe56?source=rss-0eb935413b3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ff1a10d4fe56</guid>
            <category><![CDATA[apex]]></category>
            <category><![CDATA[interactive-report]]></category>
            <dc:creator><![CDATA[Ahmed Samir]]></dc:creator>
            <pubDate>Tue, 03 Sep 2024 08:44:33 GMT</pubDate>
            <atom:updated>2024-09-03T09:09:23.986Z</atom:updated>
            <content:encoded><![CDATA[<h3>APEX Interactive Report — Mandatory Search Filter</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*kXaGPYLeZTRp_AbTp3LOlQ.jpeg" /></figure><p>In this blog, I will demonstrate how to force end users to enter a value in the Oracle APEX Interactive Report’s search field in order to get data.</p><p>In some situations, you may want interactve reports to be initialized without data and wait for end users to enter some value in the search field to filer based on their inputs.</p><p>For that, I am using “<strong>Strategic Planner</strong>” starter app from APEX Gallery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rTEYEWzPx6k9uWllkJ8myQ.png" /></figure><p>After installing the application, or maybe you have your own application with interactive reports, you can explore any page that contains an Interactive Report. In my case I will use Releases page, and if you see the screenshot interactive report renders “Projects” rows automically after page initialization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJVcoVYPpmNOONMMJCrrpg.png" /></figure><p>Navigate to the page in APEX Application Builder and locate “Projects” Interactive Report region and add the following condition at the end of the query:</p><pre>and :apex$f1 is not null</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ls_gi_NM5ytlN5Z_qtqyVg.png" /></figure><p>Press “OK” and “Save” page changes.</p><p>Now if you go back to application page and refresh, you will see that report retuns no rows after page initilization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CKf0ZCUjkfw61lQzoOac1w.png" /></figure><p>Now, try to enter a valid value in the Interactive Report search field and filter to see returned data rows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7W9Oa6ZHKMj0VgneAavi3Q.png" /></figure><p>That’s it. A quick tip with a small condition.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ff1a10d4fe56" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Authenticate ORDS using OCI IAM Domain OAuth2 tokens]]></title>
            <link>https://medium.com/@a7med_samir/authenticate-ords-using-oci-iam-domain-oauth2-tokens-a8d7109dd707?source=rss-0eb935413b3e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a8d7109dd707</guid>
            <dc:creator><![CDATA[Ahmed Samir]]></dc:creator>
            <pubDate>Fri, 02 Aug 2024 14:13:37 GMT</pubDate>
            <atom:updated>2024-08-02T19:16:20.805Z</atom:updated>
            <content:encoded><![CDATA[<p>You can extend ORDS services OAuth2 authentication to be through OCI IAM Domain Tokens. OAuth2 is a security requirement for most companies and a best practice for Oracle Restful Data Services (ORDS).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CeXLT9zWzMbrMXUXdA3PQg.png" /></figure><p><strong>Pre-requisites</strong>:</p><ul><li>Oracle Autonomous Database with enabled ORDS.</li><li>Oracle OCI IAM Domain</li></ul><p>1- <strong>Locate JWK URI</strong>: You can locate the value under the <strong>jwks_uri</strong> JSON key through the following link <strong>https://&lt;identity_domain_host&gt;/.well-known/openid-configuration</strong> of your targeted OCI IAM Domain</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KMu6HPNGPNCwnFYBmg6TQg.png" /></figure><p>Once you have located the jwks_uri, open it in your browser to validate that it is accessible:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6XTivOC3qgFAQNqxLd7sgg.png" /></figure><p>If you get an error.common.exception.unauthorizedAccess when attempting to view the jwks_uri in your browser, you will need to allow access via the OCI IAM Domain console. To enable access to the URI, open your OCI IAM Domain console and navigate to Settings &gt; Domain Settings. Enable the “Confiugre client access” checkbox under Access Signing Certificate:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BNkHRRq3pbD-pE_9RZRatQ.png" /></figure><p>2- <strong>Get Issuer Hostname</strong>: You can get this value through any previously generated token from OCI IAM Domain and decode it through jwt.io. By default it should be “https://identity.oraclecloud.com/”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vAILHnRxMJ295B4-55ws5Q.png" /></figure><p>You may notice issuer is also available under openid-configuration url of your OCI IAM Domain that we used in the previous step (#1) to get jwks_uri:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KMu6HPNGPNCwnFYBmg6TQg.png" /></figure><p>3- <strong>Get Autonomous Database base URL</strong>: You can get this from OCI Console. Only base URL is needed without any context. example: <a href="https://g1d51d536f4dbe5-etihadraildevdb.adb.me-abudhabi-1.oraclecloudapps.com/">https://&lt;dbinstance_name&gt;.adb.me-abudhabi-1.oraclecloudapps.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dbK3P6IJ4Luryg9P0yFwIw.png" /></figure><p>4- <strong>Create a JWT Profile using any SQL Tool</strong>: To configure ORDS with JWT you will set the JWT profile for your database schema by running OAUTH.CREATE_JWT_PROFILE from within that schema.</p><pre>BEGIN<br>    OAUTH.CREATE_JWT_PROFILE(<br>        p_issuer =&gt; &#39;https://identity.oraclecloud.com/&#39;,<br>        p_audience =&gt; &#39;https://&lt;dbinstancename&gt;.adb.me-abudhabi-1.oraclecloudapps.com/&#39; ,<br>        p_jwk_url =&gt;&#39;https://idcs-&lt;domain_identitifer&gt;.identity.oraclecloud.com/admin/v1/SigningCert/jwk&#39;<br>    );<br>    commit;<br>END;<br>/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MfauokYNGYDKLzrs-oS8Jg.png" /></figure><p>5- <strong>Create an ORDS Module</strong>:</p><p>Create an ORDS module and protect it with a privilege.</p><p>Borrowing the idea from the Jeff Smith <a href="https://www.thatjeffsmith.com/archive/2021/11/ords-oauth2-clients-who-are-you-hint-current_user/">post</a>, I just used a simple service that returns the current ORDS user (:current_user). There are multiple options for working with ORDS services but I am working in the APEX UI. I created a new module and template and created this GET handler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E7HXmDEEKUEjknzTWYHq1g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xv7F5FtekVG_m2XKFgfV_w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H8qJ-7sL1m1n6qH6TXtIZA.png" /></figure><p>6- <strong>Create an OCI IAM Domain Application</strong>:</p><p>Create a new confidential application under your targeted OCI IAM Domain that will be used to generate JWT Token for authentication.</p><p>a. Add a new Application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x__7YXWcW-TfBYmeg7DobA.png" /></figure><p>b. Select Confidential Application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X4Fh4cYCKWBqMN66gRgVcw.png" /></figure><p>c. Enter Application Name and leave remaining fields as defaults then click “Next”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GC844RWDrs9i7lg2FyoQiQ.png" /></figure><p>d. Enable a server configuration to add audiance URL which is your database base URL. In addition, you will have to define your ORDS defined privilege as a scope.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7G1xIosXrlb1YUusV7TQLw.png" /></figure><p>e. Configure your application as a client according to the following. Then leave all other fields as defaults, click “Next”, “Create” and finally “Activate” your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1cFFy7h2TIrv3EpE-ckgkA.png" /></figure><p>f. Save your application “Client Id” and “Client Secret” because you will need them to invoke ORDS API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M12XDO7Cy-aAG5zRcWDCGg.png" /></figure><p>7- <strong>Test API in Postman</strong>: You are now ready to test your API in Postman</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TJOcSfpmK9BnlceBKpQ6Qw.png" /></figure><p><strong>Token Name</strong>: Anyname of your choice</p><p><strong>Grant Type</strong>: Client Credentials</p><p><strong>Access Token URL</strong>: OCI IAM Domain OAuth2 URL To generate token. Example: <a href="https://idcs-6adebd8e3e7c41b5ac43eafa80332cdc.identity.oraclecloud.com/oauth2/v1/token">https://idcs-&lt;domain_identifier&gt;.identity.oraclecloud.com/oauth2/v1/token</a></p><p><strong>Client ID</strong>: Your Confidential Application Client Id.</p><p><strong>Client Secret</strong>: Your Confidential Application Client Secret.</p><p><strong>Scope</strong>: This should be a concatenation of your audience server url and scope. This should be exactly similar to what you have defined at your confidential application level. Example: <a href="https://g1d51d536f4dbe5-etihadraildevdb.adb.me-abudhabi-1.oraclecloudapps.com/dev.who">https://&lt;dbservicename&gt;.adb.me-abudhabi-1.oraclecloudapps.com/dev.who</a></p><p>After entering all details click “Get New Access Token” and then “Proceed”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*6XLRMx-x4J97V13RtDAPjw.png" /></figure><p>A new JWT Token has been generated successfully. Click “Use Token”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iATHIvaxPnSszDj2JMbaHw.png" /></figure><p>Finally, Click “Send” to invoke your ORDS API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9xSJqrCUQjBObpbh0jk6Yw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a8d7109dd707" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>