<?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 Prabod Prasanga on Medium]]></title>
        <description><![CDATA[Stories by Prabod Prasanga on Medium]]></description>
        <link>https://medium.com/@bbpprasanga?source=rss-8a0665465d58------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ZvOTa9nEpM60zXh6P-ddIw.png</url>
            <title>Stories by Prabod Prasanga on Medium</title>
            <link>https://medium.com/@bbpprasanga?source=rss-8a0665465d58------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 23:49:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bbpprasanga/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[Create apim project and deploy through Gitlab CI/CD using apictl]]></title>
            <link>https://medium.com/@bbpprasanga/create-apim-project-and-deploy-through-gitlab-ci-cd-using-apictl-53e03670bf09?source=rss-8a0665465d58------2</link>
            <guid isPermaLink="false">https://medium.com/p/53e03670bf09</guid>
            <dc:creator><![CDATA[Prabod Prasanga]]></dc:creator>
            <pubDate>Mon, 12 Jun 2023 13:07:12 GMT</pubDate>
            <atom:updated>2023-06-12T13:38:49.853Z</atom:updated>
            <content:encoded><![CDATA[<h3>Deployment diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/771/1*y0kKKwOyG4APHWSpTCj2sA.jpeg" /></figure><p>This only have two environments dev and prod. You can extend this according to your environment count.</p><h3>Create apim project using apictl</h3><p>Note: You need to setup apictl in you local machine before start initialise the apim project using wso2 apictl. Follow this: <a href="https://apim.docs.wso2.com/en/4.0.0/install-and-setup/setup/api-controller/getting-started-with-wso2-api-controller/">https://apim.docs.wso2.com/en/4.0.0/install-and-setup/setup/api-controller/getting-started-with-wso2-api-controller/</a></p><p>1. Create gitlab project with matching name for your apim project.</p><p>2. Clone newly created repository.</p><p>3. Navigate to the cloned empty project and initialise apim project using below sample command.</p><p>apictl init &lt;Project Path&gt;</p><p>ex: apictl init sample-apim-project</p><p>Reference: <a href="https://apim.docs.wso2.com/en/latest/install-and-setup/setup/api-controller/managing-apis-api-products/importing-apis-via-dev-first-approach/#initialize-an-api-project">https://apim.docs.wso2.com/en/latest/install-and-setup/setup/api-controller/managing-apis-api-products/importing-apis-via-dev-first-approach/#initialize-an-api-project</a></p><p>this will create all the necessary artifacts (folders and files) for the apim project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*rZU9p1g3WCxdgelfF1KK4A.png" /></figure><p>4. You can update below artifacts as per your requirement</p><ul><li>Definitions → swagger.yaml : API definition for your API.</li><li>api.yaml : API configurations.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*w5QTh-MrXIYbmq2jMi3-ng.png" /></figure><ul><li><a href="http://readme.md/">README.md</a> : readme file of your project</li></ul><p>5. Push the code into repository.</p><h3>Deploy apim project through Gitlab CI/CD pipeline using apictl</h3><p>1. Create .gitlab-ci.yml file for pipeline configurations.</p><p>2. Add below sample config and update according to your project.</p><pre>variables:<br>  DEV_APIM_URL: https://dev.apim.wso2.com<br>  PROD_APIM_URL: https://apim.wso2.com<br><br>stages:          <br>  - deploy<br><br>before_script:<br>  - |<br>    echo &quot;Before script section&quot;<br>    pwd<br>    wget https://apim.docs.wso2.com/en/4.0.0/assets/attachments/learn/api-controller/apictl-4.0.3-linux-x64.tar.gz<br>    tar -xvf apictl-4.0.3-linux-x64.tar.gz<br>    ls<br><br>    export PATH=$PATH:/builds/ac/&lt;project name&gt;/apictl<br>    apictl version<br><br>after_script:<br>  - echo &quot;After script section&quot;<br><br>deploy_dev:<br>  stage: deploy<br>  script:<br>    - |<br>      apictl add env dev --apim ${DEV_APIM_URL}<br>      apictl login dev -u ${DEV_APIM_ADMIN_USERNAME} -p ${DEV_APIM_ADMIN_PASSWORD} -k<br>      apictl import api -f &lt;project name&gt; -e dev --update --verbose --preserve-provider -k<br><br>  rules:<br>    - if: $CI_COMMIT_BRANCH == &quot;develop&quot;<br><br>deploy_prod:     <br>  stage: deploy<br>  script:<br>    - |<br>      apictl add env prod --apim ${PROD_APIM_URL}<br>      apictl login prod -u ${PROD_APIM_ADMIN_USERNAME} -p ${PROD_APIM_ADMIN_PASSWORD} -k<br>      apictl import api -f &lt;project name&gt; -e prod--update --verbose --preserve-provider -k<br>      <br>  when: manual<br>  rules:<br>    - if: $CI_COMMIT_BRANCH == &quot;main&quot;</pre><p>Update this according to your requirement.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=53e03670bf09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Changing the WSO2 Management console’s interface]]></title>
            <link>https://medium.com/@bbpprasanga/changing-the-wso2-management-consoles-interface-3754c48822dc?source=rss-8a0665465d58------2</link>
            <guid isPermaLink="false">https://medium.com/p/3754c48822dc</guid>
            <dc:creator><![CDATA[Prabod Prasanga]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 11:47:29 GMT</pubDate>
            <atom:updated>2023-02-24T11:47:29.460Z</atom:updated>
            <content:encoded><![CDATA[<p>The user interfaces of every Carbon product allows you to configure, monitor, tune, and maintain the product. The components that formulate the design and style of these user interfaces are defined in resource (JAR) files.</p><p>The user interface of every Carbon product consists of two layers:</p><ul><li>The common product layout/design inherited from the Carbon platform: All the common templates, styles (CSS files), and images are stored in the Carbon core UI bundle, which is named org.wso2.carbon.ui-&lt;version-number&gt;.jar ( &lt;version-number&gt; is the particular version of the bundle). This bundle is responsible for the overall look and feel of the entire Carbon platform.</li><li>The styles/images unique to each product: Each Carbon product (that is built on Carbon kernel) has another style bundle, which contains all the overriding style sheets and images: org.wso2.&lt;product-name&gt;.styles-&lt;version-number&gt;.jar.</li></ul><p>You can customize the user interfaces by modifying these resource files. You need to create a fragment bundle for the original resource file. Then, you can pack the modified resource files in the required bundle. The files in the required bundle will get precedence and will override the files in the original bundle.</p><p>You can use this same technique to customize any aspect of the user interfaces. The advantage of this technique is that you will not lose your customizations when you apply official patches to the product by replacing the original bundles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*JoLnHzvBf8PunNIx.png" /></figure><h3>Follow the steps below to customize the above management console by changing the logo.</h3><ol><li>Open the &lt;PRODUCT_HOME&gt;/repository/components/plugins/directory. You need to find the bundle that contains the resource files that you want to modify. In this case, the logo and the related CSS files are contained in the org.wso2.carbon.ui_&lt;version-number&gt;.jar file. Copy the org.wso2.carbon.ui_&lt;version-number&gt;.jar file to a separate location on your computer, and extract the file. Note the symbolic name of this bundle, which is org.wso2.carbon.ui_&lt;version-number&gt;.</li><li>Create a new Maven project using your IDE. Be sure to include the symbolic name of the original bundle that you extracted in the previous step (which is org.wso2.carbon.ui_&lt;version-number&gt;) in the Maven project name. For example, you can use org.wso2.carbon.ui_&lt;version-number&gt;_patch as the Maven project name.</li><li>Add the following content to the In this pom.xml file of the org.wso2.carbon.ui_&lt;version-number&gt;_patch project. org.wso2.carbon.ui_&lt;version-number&gt;pom.xml file, be sure to replace the &lt;version-number&gt; of _patch with the correct version value. (ex: org.wso2.carbon.ui_4.5.3_patch)</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*18pWCZetTDS0-gtV.png" /></figure><p>4. Create directories in your Maven project as explained below.</p><ul><li>Create the /web folder under the /src/main/resources directory of the org.wso2.carbon.ui_&lt;version-number&gt;_patch project.</li><li>Then, create the /admin directory under /web.</li><li>Finally, create the /css, /images, and /layout directories under /admin.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/0*xXlQjB4bJXuTAw-9.png" /></figure><p>5. Create a new CSS file (e.g. with the following content and Add the customizations.css) customizations.css file to the org.wso2.carbon.ui_&lt;version-number&gt;_patch/src/main/resources/web/admin/css/ directory. This file contains the logo customization styles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*LU-vGKpCqFkWmea9.png" /></figure><p>6. Locate the template.jsp file that is in the org.wso2.carbon.ui_&lt;version-number&gt;.jar bundle, which you extracted in step 1 above. You will find template .jsp file inside the org.wso2.carbon.ui_&lt;version-number&gt;.jar/web/admin/layout/directory. Then, copy this file to the org.wso2.carbon.ui_&lt;version-number&gt;_patch/src/main/resources/web/admin/layout/ directory.</p><p>7. Add below line into this template.jsp file. &lt;link href=&quot;../admin/css/customizations.css&quot;rel=&quot;stylesheet&quot;type=&quot;text/css&quot;media=&quot;all&quot;/&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*nQo8bOvqC723Eqv2.png" /></figure><p>8. You can update the Title and the favicon as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*dJhsMrkHy3dm9fbF.png" /></figure><p>9. Add the new image as the new logo (e.g. new-logo.png) to the org.wso2.carbon.ui_&lt;version-number&gt;_patch/src/main/resources/web/admin/images/ directory.</p><p>10. Create another Maven project using your IDE. Be sure to include the symbolic name of the original bundle that you extracted in step 1 above (which is org.wso2.carbon.ui_&lt;version-number&gt;) in the project name. For example, you can use org.wso2.carbon.ui_&lt;version-number&gt;_fragment as the Maven project name. This creates a project for the fragment bundle. Since the symbolic name of the original bundle is org.wso2.carbon.ui, the fragment host value of this bundle should be the same (e.g. o rg.wso2.carbon.ui_&lt;version-number&gt;_fragment). This fragment bundle will not contain anything (expect the pom.xml file) when it is built.</p><p>11. In this (ex: Add the following content to the pom.xml file of the org.wso2.carbon.ui_&lt;version-number&gt;_fragment project. org.wso2.carbon.ui_&lt;version-number&gt;_patch)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*pCr0eQy-zFsZnY0C.png" /></figure><p>12. Now you can build the two projects. Open a terminal, navigate to the relevant project directory (listed above), and execute the following command: mvn clean install.</p><ul><li>org.wso2.carbon.ui_&lt;version-number&gt;_fragment</li><li>org.wso2.carbon.ui_&lt;version-number&gt;_patch</li></ul><p>13. Once the project is built, copy the two JAR files listed below (from the &lt;PROJECT_HOME&gt;/target/ directory) to the &lt;PRODUCT_HOME&gt;/dropins/ directory.</p><ul><li>org.wso2.carbon.ui_&lt;version-number&gt;_fragment-1.0.0.jar</li><li>org.wso2.carbon.ui_&lt;version-number&gt;_patch-1.0.0.jar</li></ul><p>14. Restart the WSO2 product server.</p><p>15. Access the management console of your WSO2 product using the following URL: You view the new logo, which the patch bundle contains as shown below. <a href="https://10.100.5.12:9443/carbon/">https://localhost:9443/carbon/</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*KSxGVwz82piSIeZJ.png" /></figure><p><em>Originally published at </em><a href="http://prabodtechblog.blogspot.com/2021/08/changing-wso2-management-consoles.html"><em>http://prabodtechblog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3754c48822dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Iterator and aggregator mediator example using call mediator with blocking=’true’]]></title>
            <link>https://medium.com/@bbpprasanga/iterator-and-aggregator-mediator-example-using-call-mediator-with-blocking-true-bcbf4f01b5c6?source=rss-8a0665465d58------2</link>
            <guid isPermaLink="false">https://medium.com/p/bcbf4f01b5c6</guid>
            <dc:creator><![CDATA[Prabod Prasanga]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 11:37:01 GMT</pubDate>
            <atom:updated>2023-02-24T11:37:01.346Z</atom:updated>
            <content:encoded><![CDATA[<p>This example showcase how to use a call mediator with blocking=true (Synchronous way — wait for the API response and call next) inside the iterator mediator and aggregate response inside the aggregator mediator.</p><h3>Sample Request payload used:</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d738085ab1708650c44a3d985ab23948/href">https://medium.com/media/d738085ab1708650c44a3d985ab23948/href</a></iframe><h3>Sample code:</h3><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/db90cbbf56d08ee42e9a85a30be38a0b/href">https://medium.com/media/db90cbbf56d08ee42e9a85a30be38a0b/href</a></iframe><p>In this example, I’m calling the mock backend to test the scenario.</p><p><a href="http://prabod:8313/services/echo">http://prabod:8313/services/echo</a></p><p>This will iterate all the account numbers and call the backend by passing the account number inside the iterator mediator. Finally, aggregate all the responses into one response payload inside aggregator mediator. In this scenario, I need this to be synchronous. In that case, we need to use the call mediator with blocking=”true” and the aggregator mediator needs to be inside out-sequence.</p><p><em>Originally published at </em><a href="http://prabodtechblog.blogspot.com/2022/01/iterator-and-aggregator-mediator.html"><em>http://prabodtechblog.blogspot.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bcbf4f01b5c6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[WSO2 EI Backend Retry Handling]]></title>
            <link>https://medium.com/@bbpprasanga/wso2-ei-backend-retry-handling-1b8732c8a593?source=rss-8a0665465d58------2</link>
            <guid isPermaLink="false">https://medium.com/p/1b8732c8a593</guid>
            <dc:creator><![CDATA[Prabod Prasanga]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 10:37:12 GMT</pubDate>
            <atom:updated>2023-02-24T10:52:43.116Z</atom:updated>
            <content:encoded><![CDATA[<h3>Use case:</h3><p>Retry backend call 3 times with 5 seconds delay when backend not available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/642/0*Hf5BUn5btX0eMu47.png" /></figure><h3>Implementation:</h3><p>Use below in-sequence and fault-sequence for your mediation.</p><h4>1. sample-mediation-in-sequence</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4d42cb32624d6950528d594718367e1f/href">https://medium.com/media/4d42cb32624d6950528d594718367e1f/href</a></iframe><p>Note: Change this as per your backend.</p><h4>2. sample-mediation-fault-sequence</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bf0bee445aafcdb99d289ed8e43522a5/href">https://medium.com/media/bf0bee445aafcdb99d289ed8e43522a5/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1b8732c8a593" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding custom headers filter in WSO2 Micro Gateway]]></title>
            <link>https://medium.com/@bbpprasanga/adding-custom-headers-filter-in-wso2-micro-gateway-2cebfd8780e1?source=rss-8a0665465d58------2</link>
            <guid isPermaLink="false">https://medium.com/p/2cebfd8780e1</guid>
            <dc:creator><![CDATA[Prabod Prasanga]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 10:21:53 GMT</pubDate>
            <atom:updated>2024-11-11T10:50:00.050Z</atom:updated>
            <content:encoded><![CDATA[<p>Filters are a set of execution points in the request and response flow that intercept the request before it goes to the backend service and intercepts the response before forwarding it to the client. Filters are applied to all the APIs exposed via Microgateway. Custom filter can be engaged to Microgateway runtime using the Microgateway toolkit. If there is a common functionality required by all the APIs exposed via the Microgateway then a custom filter written in <a href="https://www.blogger.com/u/1/blog/post/edit/8004954994129863514/8195802944011504403#">ballerina language</a> can be used for that</p><p>Use case:</p><p>There are few mandatory headers with maximum character length that need to pass to the API. This filter will not affect if the resource has a “/callback”</p><p>Sample Headers: AppId (Length:10), AppVersion (Length:10), RequestId (Length:36)</p><p>Save the below content as <strong>header_validation_filter.bal </strong>in<strong> </strong>location &lt;PROJECT_HOME&gt;/extensions folder.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f48a040130f5a6d253e1168af9246bf3/href">https://medium.com/media/f48a040130f5a6d253e1168af9246bf3/href</a></iframe><p>Define the custom filter in the deployment-config.toml file as below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c11c17550afb2766f1cba0ebb5e15963/href">https://medium.com/media/c11c17550afb2766f1cba0ebb5e15963/href</a></iframe><ul><li>name: Name of the filter object defined in the .bal file. Ex: CustomFiler</li><li>position: The position of the filter to be engaged. By default, microgateway has the following set of filters. By defining the position it can engage the custom filter in between any default filter chain</li></ul><p><strong><em>gRPC Filter:</em></strong><em>Filter to handle gRPC backend services.</em></p><p><strong><em>Pre Authentication Filter: </em></strong><em>Filter to prepare the request prior to authentication checks</em></p><p><strong><em>Authentication Filter:</em></strong><em>Handles the authentication based on the different auth types. For ex: OAuth2, Basic and etc</em></p><p><strong><em>Authorization Filter:</em></strong><em>Handles the Authorization</em></p><p><strong><em>Validation Request Filter:</em></strong><em>Handles the open API schema validation for the request</em></p><p><strong><em>Throttle Filter:</em></strong><em>Handles the rate limiting capabilities</em></p><p><strong><em>Analytics Filter:</em></strong><em>Capture and publish analytics realted dat to analytics server</em></p><p><strong><em>Validation Response Filter:</em></strong><em>Handles the open API schema validation for the response</em></p><p><strong><em>Extension Filter:</em></strong><em>Common filter that can be used to customize error messages for authentication,throttling failure releated scenarios</em></p><p>Then build the project. Custom filter will be engaged in the runtime</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2cebfd8780e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuring a Distributed API Manager Deployment with Gateway and Control Plane]]></title>
            <link>https://medium.com/@bbpprasanga/configuring-a-distributed-api-manager-deployment-with-gateway-and-control-plane-97038dd89d8d?source=rss-8a0665465d58------2</link>
            <guid isPermaLink="false">https://medium.com/p/97038dd89d8d</guid>
            <dc:creator><![CDATA[Prabod Prasanga]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 10:14:06 GMT</pubDate>
            <atom:updated>2023-02-24T11:20:57.335Z</atom:updated>
            <content:encoded><![CDATA[<p>In the distributed setup, the API-M server profiles are deployed as separate API-M nodes. Followings are the APIM nodes you can have in a distributed deployment support for our pattern.</p><ul><li>Gateway Worker Node — API-M nodes running the Gateway profile.</li><li>Control Plane Node — API-M nodes running the Control Plane profile. The Control Plane includes the Traffic Manager, Key Manager, Publisher, and Developer Portal components.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/0*5BbRzllUmiKBO8Iz.png" /></figure><h3>1. Install WSO2 API Manager</h3><ul><li>Download the <a href="https://www.blogger.com/u/1/blog/post/edit/8004954994129863514/7781695334975936993#">WSO2 API Manager</a>.</li><li>Create copies of the API-M distribution for the individual profiles</li></ul><h3>2. Install and configure the databases</h3><p>You can create the required databases for the API-M deployment in a separate server and point to the databases from the respective nodes.</p><p>Below are the default databases which will be used within API Manager.</p><ul><li>WSO2AM_DB — WSO2 API Manager has this database keeping its specific API-M related data.</li><li>WSO2SHARED_DB — This database contains the registry and user management data.</li><li>WSO2CARBON_DB — This database has the internal data related to the product.</li></ul><p>Databases used by API-M profiles:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yrXFEu1egPWRFya45oM_Pg.png" /></figure><p>It is recommended to use an industry-standard RDBMS such as Oracle, PostgreSQL, MySQL, MS SQL, etc. WSO2 products are shipped with scripts for creating the required tables in all the required databases: The scripts for creating tables for API-M, user management, and registry data are stored in the &lt;API-M_HOME&gt;/dbscripts directory.</p><p>In this example i’m using PostgreSQL.</p><h3>3. Create and import SSL certificates</h3><p>Create an SSL certificate for each of the WSO2 API-M nodes and import them to the keystore and the truststore. This ensures that hostname mismatch issues in the certificates will not occur.</p><p>Note: The same primary keystore should be used for all API Manager instances to decrypt the registry resources.</p><p>For more details:</p><p><a href="https://www.blogger.com/u/1/blog/post/edit/8004954994129863514/7781695334975936993#">https://apim.docs.wso2.com/en/latest/install-and-setup/setup/security/configuring-keystores/keystore-basics/creating-new-keystores/</a></p><p><a href="https://www.blogger.com/u/1/blog/post/edit/8004954994129863514/7781695334975936993#">https://apim.docs.wso2.com/en/latest/install-and-setup/setup/security/configuring-keystores/configuring-keystores-in-wso2-api-manager/</a></p><h3>4. Configure and start the profiles</h3><h4>4.1 Configure the Gateway Nodes</h4><p>Follow these steps to configure the Gateway to communicate with the Control Plane.</p><p>Open the &lt;API-M_HOME&gt;/repository/conf/deployment.toml file of the Gateway node.</p><p>Add the following configurations to the deployment.toml file.</p><p>Note: Update the parameters as necessary.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/103e6496418a58938c41cebb9967f51f/href">https://medium.com/media/103e6496418a58938c41cebb9967f51f/href</a></iframe><h4>4.2 Configure the Control Plane Nodes</h4><p>Follow these steps to configure the Control Plane to communicate with the Gateway.</p><p>Open the &lt;API-M_HOME&gt;/repository/conf/deployment.toml file of the Gateway node.</p><p>Add the following configurations to the deployment.toml file.</p><p>Note: Update the parameters as necessary.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c74a84010ed7dd0dd87a8e96911e6a87/href">https://medium.com/media/c74a84010ed7dd0dd87a8e96911e6a87/href</a></iframe><p>Open the server’s /etc/hosts file and map the hostnames to IPs.</p><p>Format:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3bfccae6b770838fb55e44e54b7921e/href">https://medium.com/media/a3bfccae6b770838fb55e44e54b7921e/href</a></iframe><h4>4.3 Configure carbon.xml</h4><p>Configure carbon.xml file if you using custom keystores as below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e593ff8c2af44ef9367a37c38580e55a/href">https://medium.com/media/e593ff8c2af44ef9367a37c38580e55a/href</a></iframe><h4>4.4 Configure load balancers</h4><p>You need to properly configure load balancers fronting the two Control Plane nodes and two Gateway nodes.</p><h4>4.5 Start the API-M nodes</h4><p>Before starts the servers,</p><p>Execute the control plane optimization:</p><ul><li>cd &lt;API-M_HOME&gt;/bin/</li><li>sh profileSetup.sh -Dprofile=control-plane</li></ul><p>Execute the gateway optimization:</p><ul><li>cd &lt;API-M_HOME&gt;/bin/</li><li>sh profileSetup.sh -Dprofile=gateway-worker</li></ul><p>Once you have successfully configured all the API-M nodes in the deployment, you can start the servers.</p><p>Starting the Gateway nodes</p><p>Open a terminal, navigate to the &lt;API-M-GATEWAY-HOME&gt;/bin folder, and execute the following command</p><ul><li>cd &lt;API-M_HOME&gt;/bin/</li><li>sh api-manager.sh -Dprofile=gateway-worker</li></ul><p>Start the Control Plane nodes</p><p>Open a terminal, navigate to the &lt;API-M-CONTROL-PLANE-HOME&gt;/bin folder, and execute the following command:</p><ul><li>cd &lt;API-M_HOME&gt;/bin/</li><li>sh api-manager.sh -Dprofile=control-plane</li></ul><h3>5. Sample APIM deployment architecture in Azure cloud.</h3><p>This is the sample architecture of the APIM deployment in Azure using Azure VMs, Azure scaleset, Azure Load-balancer and Azure Active Directory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/0*qzKuEEoUCxpu7hPQ.jpg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97038dd89d8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Integrate Azure AD for API Authentication in WSO2 APIM]]></title>
            <link>https://medium.com/@bbpprasanga/configure-wso2-api-manager-federated-authentication-with-azure-active-directory-4da2b1a0620a?source=rss-8a0665465d58------2</link>
            <guid isPermaLink="false">https://medium.com/p/4da2b1a0620a</guid>
            <dc:creator><![CDATA[Prabod Prasanga]]></dc:creator>
            <pubDate>Fri, 24 Feb 2023 10:01:39 GMT</pubDate>
            <atom:updated>2023-07-27T12:14:48.983Z</atom:updated>
            <content:encoded><![CDATA[<p>Here I’m covering how to configure WSO2 API Manager 4.1.0 federated authentication with Azure Active Directory step by step(OpenID connect SSO flow)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*iJBMnkCTeLHbnFVtGljgpg.jpeg" /><figcaption>Architecture</figcaption></figure><h3>1. Azure configuration.</h3><h4>1.1 Azure App Registration.</h4><p>First login to your <a href="https://portal.azure.com/">Azure portal</a> with your credentials. If you don’t have an account you can create a free trial account to check this scenario.</p><p>Once you successfully logged-in you can see as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/656/0*t3Evoou79efAH9uc.png" /></figure><p>Click on the Azure Active Directory and select which AD you want to use. If you don’t have created AD then you can create a new one for this by clicking on the Create Directory icon. Enter the required details and create new one. It will take few minuted to create an AD for you.</p><p>Once all done with new creation select the Azure AD and select <strong>App registration </strong>on the left navigation panel to register an Open ID client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/0*etNB3HDminYBKM3y.png" /></figure><p>Click on the <strong>New registration</strong> and enter the following details:</p><ul><li>Name: wso2-apim (any desired name as you want)</li><li>Supported Account Types: Accounts in this organizational directory only (You can change this according to your requirement)</li><li>Redirect URI: Web , https://&lt;hostname&gt;:9443/commonauth (change the hostname according to your environment&#39;s host name)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/0*izRvcU_FgJOJ2UX3.png" /></figure><p>And click on <strong>Register</strong>.</p><p>After successful creation you will be redirected to a general info page of the registered application. On this page copy and save the <strong>Application (client) ID</strong> as it will need for API Manager configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/0*TNC7nLl2ErPr3sZp.png" /></figure><p>Then click on the <strong>Certificates &amp; secrets</strong> section in the left side panel and select the <strong>New client secret</strong> to generate a secret for our newly created wso2-apim application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*R84FI3Y7Bmkr-RBK.png" /></figure><p>Enter the following details and click Add.</p><ul><li>Description: WSO2APIMDEV OIDC Secret (You can change this as per your choice)</li><li>Expires: Select your desired time period</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/433/0*shdREpkjLqhPCfo3.png" /></figure><p>Then click on <strong>Add</strong>.</p><p>Copy and save the generated client secret value.</p><p>After that click on the <strong>API permissions</strong> in the left navigation panel to configure the OpenID and Profile scope permissions to your application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/0*8Hxt-tmJgiRSrgSu.png" /></figure><p>Click on the <strong>Add a permission</strong> button to add new permissions. Once you click, you will see a side window popped up with the following options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/496/0*rjoKt_KR1Hsd11cO.png" /></figure><p>Choose the Microsoft Graph option and select Delegated permissions on the following screen. Then select the following permissions.</p><ul><li>email</li><li>openid</li><li>profile</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*DPTYvyGmbYEGJ9Rr.png" /></figure><p>Click on <strong>Add permissions</strong>. Leave the existing permissions as it is. Then you can see the all configured API permissions as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/645/0*hmFvFttenYApCXNW.png" /></figure><h3>1.2 Group Registration.</h3><p>Since we are configuring the SSO flow with Azure AD, we will be creating a security group called Subscriber to represent the subscriber role in the Azure service. For Publisher and Creator roles you need to create separate groups respectively.</p><p>Note: You can create Roles in the azure service and assign them to Users. In addition, you can also create Groups in Azure AD and assign it to your Users.</p><p>Click on the Groups on your AD and there click on <strong>New group</strong> button. Then you will see it as below. Fill the followings in there.</p><ul><li>Group type: Security</li><li>Group name: Subscriber</li><li>Group description: Group for subscriber</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/0*jp_-8v983livrDHM.png" /></figure><p>Click on the No owners selected. On the prompted side window, select on owner’s Azure accounts you need to add.</p><p>Then click on the No members selected. As above step selects desired members you want to add.</p><p>And finally click on Create. You can see the newly created group as below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/0*MflKy-HJ8Q3earaU.png" /></figure><p>Take a note of the Object id value.</p><p>Note: This is to map the Groups with the API Manager’s internal roles. We will be using the Object IDs of the groups to map the roles in the API Manager.</p><p>Create Another Groups for Publisher and Creator as well.</p><h3>1.2.1 Add Groups claim.</h3><p>Now we have to configure our Azure application to populate the Groups claim in the ID token. Go to the Azure application (wso2-apim) and click on Token configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/0*YxHC0gEh4uHa-H4M.png" /></figure><p>Click on the <strong>Add group claim</strong> and tick the security groups. Then expand the ID and choose the Group ID and enable Emit groups as role claims and click on <strong>Add</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/0*ZRWDhY-zn_AdY4hw.png" /></figure><p>Now all the set with the Azure configurations. But before moving forward, we will make a note on the <strong>Authorization</strong> and <strong>Token endpoints</strong> of our Azure application. We will need these endpoints when configuring an Identity provider in the API Manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/0*1qASvOKWRCYQY45D.png" /></figure><p>Go to the Overview page of the Azure application and click on the Endpoints button as above. This will pop a side-window with all the necessary endpoints of our application. Make a note on the <strong>Authorization v2</strong> and <strong>Token v2</strong> endpoints. In addition to the above-set, also make a note on the OpenID Connect metadata document endpoint.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/0*8FFzpohUoCrxMNyF.png" /></figure><p>If you go to the endpoint URL mentioned in the OpenID Connect metadata document, you will find a set of metadata to configure an Identity Provider in the API Manager.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/0*jCP-3IbWT-eFJCyj.png" /></figure><h3>2. WSO2 API Manager configuration.</h3><p>First of all you need to enable “enable_email_domain” property in the API Manager. Reason behind it “preferred_username” claim in Azure ID token represented with email username. So we will be enabling email username in our API Manager server to provision and log-in to the Store nodes.</p><p>Go to &lt;apim-home&gt;/repository/conf and open deployment.toml file and add the following entry.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08bdc087e736311d3418922ac9e2d99d/href">https://medium.com/media/08bdc087e736311d3418922ac9e2d99d/href</a></iframe><p>email usernameAdd the following entry for the email regex validation since the default validation only checks the 30 characters.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e24d6a9a6f14fa901ebc8c219e100a80/href">https://medium.com/media/e24d6a9a6f14fa901ebc8c219e100a80/href</a></iframe><h3>2.1 Identity Provider Creation.</h3><p>Go to the Carbon Management console, and log-in with the admin credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/644/0*hLGxv6xmHoi6ld84.png" /></figure><p>Select the <strong>Add</strong> under the <strong>Identity Providers</strong> and input the followings:</p><ul><li>Identity Provide Name: AzureADIDP</li><li>Display Name: Azure AD IDP</li><li>Choose IDP Certificate Type: Use IDP JWKS Endpoint</li><li>Identity Provider’s JWKS Endpoint: the JWKS URI found in the OpenID Connect metadata document</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/0*RHVnOQ10vQEDGRfM.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/0*rDveNMgD4ltObeve.png" /></figure><p>Next, expand the <strong>Claim Configurations</strong> &gt; <strong>Basic Claim configuration</strong> &gt; <strong>Define Custom Claim Dialect</strong> &gt; <strong>Add Claim Mapping</strong> and add the following mappings</p><ul><li>preferred_username : <a href="http://wso2.org/claims/displayName">http://wso2.org/claims/displayName</a></li><li>roles : <a href="http://wso2.org/claims/role">http://wso2.org/claims/role</a></li></ul><p>and</p><ul><li>User ID Claim URI: preferred_username</li><li>Role Claim URI: roles</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/0*emddZVu0XNJeQDHb.png" /></figure><p>Expand the Role configurations and click on the Add Role Mapping. Paste the Object ID acquired from the Subscriber group in the Azure service and map it with our internal subscriber role</p><ul><li>The Object ID of Subscriber Group : Internal/subscriber</li></ul><p>Given below is a sample Role mapping configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/639/0*sDCekRT3ulU085Xl.png" /></figure><p>Update these for all other groups as well like below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/674/0*kN5aSQbqDXstt0OH.png" /></figure><p>Then, expand the <strong>Federated Authenticators</strong> &gt; <strong>OAuth2/OpenID Connect Configurations</strong> and perform the following</p><ul><li>Enable OAuth2 / OpenID Connect: true</li><li>Default: true</li><li>Client ID: the Client ID of our WSO2APIM Azure app</li><li>Client Secret: the generated secret of our WSO2APIM Azure app</li><li>Authorization Endpoint URL: the authorization_endpoint in the OpenID Connect metadata document</li><li>Token Endpoint URL: the token_endpoint in the OpenID Connect metadata document</li><li>Userinfo Endpoint URL: the userinfo_endpoint in the OpenID Connect metadata document</li><li>Additional Query Parameters: scope=openid profile email</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*gPhGXCHA9v1Xvy43.png" /></figure><p>And finally, expand the <strong>Just-In-Time Provisioning</strong> accordion and configure as follows.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/0*01vCLlIO6nRwxBbu.png" /></figure><p>And finally click on <strong>Register</strong>.</p><h3>2.2 Service Provider Creation.</h3><p>From API Manager 4.x onwards, both Publisher and Devportal nodes are configured with OIDC SSO flows as default.</p><p>Hence, go to both Publisher and Devportal nodes and click on the Sign-in button to automatically create and register a Service Provider for the OIDC SSO flow. You don’t have to log-in to the portals, the above-mentioned process is to create the respective Service Providers in the API Manager.</p><p>Navigate to the Carbon Management console and sign-in with the Admin credentials.</p><p>Click on List under Service Providers section to list the automatically created Service Providers respective to Publisher: apim_publisher and Devportal: apim_devportal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/0*gfsN4vdKT59YUq-n.png" /></figure><p>Click the Edit of the apim_devportal and expand the <strong>Claim Configurations</strong>. Select “<strong>Define Custom Claim Dialect</strong>” and make the following changes</p><ul><li>preferred_username : <a href="http://wso2.org/claims/displayName">http://wso2.org/claims/displayName</a> : Requested</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/0*cfAI7gx8e-CTdEW0.png" /></figure><p>Next, expand the <strong>Local &amp; Outbound Authentication Configuration</strong> and select the <strong>AzureADIDP</strong> as the Federated Authentication and make the following changes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/0*PLzPkfLJh4hEy-Nu.png" /></figure><p>Do the same configurations for apim_publisher.</p><p>Now we are done with all configs. We have now successfully configured OpenID Connect Federated Authentication between Azure AD and Single Sign-On with OpenID Connect with APIM Devportal and Publisher.</p><p>Go to the Publisher or devporal and click on Sign-In. You will be redirected to the Microsoft’s login page to enter the credentials. Enter the credentials of our Microsoft User and then allow the attributes on the consent screen to continue with the federation and provision of the users to the WSO2</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4da2b1a0620a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sonarqube using Docker Composer]]></title>
            <link>https://medium.com/@bbpprasanga/sonarqube-using-docker-composer-9cc1fb346eab?source=rss-8a0665465d58------2</link>
            <guid isPermaLink="false">https://medium.com/p/9cc1fb346eab</guid>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[sonarqube]]></category>
            <dc:creator><![CDATA[Prabod Prasanga]]></dc:creator>
            <pubDate>Wed, 19 Feb 2020 09:07:17 GMT</pubDate>
            <atom:updated>2023-02-24T11:24:27.055Z</atom:updated>
            <content:encoded><![CDATA[<p>Pre-requisites:</p><p><em>Docker installed in your machine.</em></p><p><a href="https://medium.com/@bbpprasanga/postgresql-docker-using-docker-compose-ee2f3bfc2fc6"><em>PostgreSQL.</em></a></p><p>Create a docker-compose.yml file as follows.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ecef9f5227fdbddf3d2471dfad27b190/href">https://medium.com/media/ecef9f5227fdbddf3d2471dfad27b190/href</a></iframe><p>Use the below command to start docker-compose.</p><blockquote>docker-compose up</blockquote><p>Go to the below URL in your browser.</p><blockquote><a href="http://localhost:9000/">http://localhost:9000/</a></blockquote><p>Insert below default username and password if required</p><blockquote>Username: admin<br>Password: admin</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cc1fb346eab" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[PostgreSQL docker using Docker Compose]]></title>
            <link>https://medium.com/@bbpprasanga/postgresql-docker-using-docker-compose-ee2f3bfc2fc6?source=rss-8a0665465d58------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee2f3bfc2fc6</guid>
            <category><![CDATA[postgresql]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[Prabod Prasanga]]></dc:creator>
            <pubDate>Wed, 19 Feb 2020 08:45:39 GMT</pubDate>
            <atom:updated>2023-02-24T11:25:38.378Z</atom:updated>
            <content:encoded><![CDATA[<p>First of all, you need to have docker setup in your machine.</p><p>Create a docker-compose.yml file like below.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4accc9f9cda7fc15a06f01bdc5bc6413/href">https://medium.com/media/4accc9f9cda7fc15a06f01bdc5bc6413/href</a></iframe><p>Open the terminal and navigate to the file location where you saved in the previous stage.</p><p>Use below command to start docker-compose.</p><blockquote>docker-compose up</blockquote><p>Install pgAdmin client and connect started PostgreSQL docker with providing the connection details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*kboKrbLAQTKCWX_6DxA3gA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee2f3bfc2fc6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Show GIT branch with colours in the bash prompt]]></title>
            <link>https://medium.com/@bbpprasanga/show-git-branch-with-colours-in-the-bash-prompt-448cc2b7525c?source=rss-8a0665465d58------2</link>
            <guid isPermaLink="false">https://medium.com/p/448cc2b7525c</guid>
            <category><![CDATA[git]]></category>
            <category><![CDATA[bash-script]]></category>
            <dc:creator><![CDATA[Prabod Prasanga]]></dc:creator>
            <pubDate>Wed, 19 Feb 2020 06:43:14 GMT</pubDate>
            <atom:updated>2023-02-24T11:27:45.090Z</atom:updated>
            <content:encoded><![CDATA[<p>Update the below code in ~/.bashrc file</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/62b8736905a70e888afa3819509a4e2c/href">https://medium.com/media/62b8736905a70e888afa3819509a4e2c/href</a></iframe><p>Comment-out below line if it’s uncommented.</p><blockquote>#unset color_prompt force_color_prompt</blockquote><p>Reload the ~/.bashrc file using below command:</p><pre>source ~/.bashrc</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/573/1*3AQCvCqNKWm8AFKv3vH_JQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=448cc2b7525c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>