<?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 Yoshani Ranaweera on Medium]]></title>
        <description><![CDATA[Stories by Yoshani Ranaweera on Medium]]></description>
        <link>https://medium.com/@yoshani-malinka?source=rss-857dd675292d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YRNfY10slqzDZWNlpsG08Q.jpeg</url>
            <title>Stories by Yoshani Ranaweera on Medium</title>
            <link>https://medium.com/@yoshani-malinka?source=rss-857dd675292d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 03:04:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yoshani-malinka/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[How to Power Up IntelliJ IDEA with CheckStyle & SpotBugs Plugins]]></title>
            <link>https://yoshani-malinka.medium.com/how-to-power-up-intellij-idea-with-checkstyle-spotbugs-3275b9088add?source=rss-857dd675292d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3275b9088add</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[wso2is]]></category>
            <category><![CDATA[spotbugs]]></category>
            <category><![CDATA[intellij-idea]]></category>
            <category><![CDATA[checkstyle-plugin]]></category>
            <dc:creator><![CDATA[Yoshani Ranaweera]]></dc:creator>
            <pubDate>Fri, 13 Dec 2024 06:28:21 GMT</pubDate>
            <atom:updated>2024-12-17T06:35:04.925Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E12GOWND1OEpADV6aVbZNA.png" /></figure><p>In my <a href="https://yoshani-malinka.medium.com/essential-intellij-idea-plugins-to-simplify-and-enhance-your-developer-life-60427a7599a8">previous article</a>, we discussed about the must-have plugins in IntelliJ IDEA to easen up your developer lifestyle, boost productivity, and improve code quality.</p><p>In this article, I will provide a step-by-step guide to help you install and configure two of those plugins; CheckStyle and SpotBugs.</p><p>Let’s get started!</p><h3>CheckStyle</h3><h4><strong>Installing the CheckStyle plugin</strong></h4><p>If you want to install the plugin from IntelliJ Marketplace:</p><ol><li>In the top menu bar, go to File → Settings → Plugins (Windows/Linux) or IntelliJ IDEA → Settings → Plugins (macOS).</li><li>In the Plugins window, click on the Marketplace tab. In the search bar, type “checkstyle”.</li><li>Find the Checkstyle-IDEA plugin in the search results and click the <em>Install</em> button next to the plugin.</li><li>After the installation is complete, click <em>Restart IDE </em>to apply the plugin.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tSHtokj5fSqmw9sr" /></figure><p>Or you can download from JetBrains Marketplace and install the plugin manually:</p><ol><li><a href="https://plugins.jetbrains.com/plugin/1065-checkstyle-idea">Download</a> the latest plugin supported by your IDE.</li><li>Navigate to Settings → Plugins.</li><li>Click on the gear icon on the top-right corner.</li><li>Click <em>Install Plugin from Disk</em> and select the downloaded plugin.</li><li>After the installation is complete, click <em>Restart IDE</em> to apply the plugin.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bLbkF0biIsB14dEH" /></figure><h4><strong>Configuring the CheckStyle plugin</strong></h4><p>We have now successfully installed CheckStyle, which comes with pre-installed configurations for Sun and Google coding standards. <br>In this tutorial, we will configure CheckStyle to use the WSO2 coding standard.</p><p>We can configure the CheckStyle plugin to apply only to the current project, or all new projects.</p><ol><li>To apply to all new projects, navigate to File → New Projects Setup → Settings for New Projects. <br>To apply to the current project only, navigate to File → Settings (Windows/Linux) or IntelliJ IDEA → Settings (macOS). <br>Please note that Settings for New Projects does not apply to projects you have already opened or imported, so you will have to configure them separately.</li><li>Then go to Tools → Checkstyle.</li><li>Set the Checkstyle version to 10.20.2 (latest as of now).</li><li>Click on the + icon under Configuration File.</li><li>Add a suitable Description (eg: WSO2 Checks).</li><li>Select<em> Use a Checkstyle file accessible via HTTP</em> and provide <a href="https://raw.githubusercontent.com/wso2/code-quality-tools/refs/heads/master/checkstyle/jdk-17/checkstyle.xml">https://raw.githubusercontent.com/wso2/code-quality-tools/refs/heads/master/checkstyle/jdk-17/checkstyle.xml</a> as the URL.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cFTbILpbNoLzE-kH" /></figure><p>7. Hit <em>Next</em> twice, select the newly added WSO2 CheckStyle profile, click <em>Apply</em> and then <em>OK</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VQnJCmYka0DNpo1W" /></figure><p>Note: If you encounter any errors during the process, try changing the Checkstyle version and try again.</p><p>You have now successfully configured Checkstyle.</p><h4><strong>Using </strong>the CheckStyle plugin</h4><ol><li>Open or create a Java project.</li><li>On the bottom-left corner, click on the CheckStyle icon.</li><li>From the Rules dropdown, select the newly added configuration.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ryL3hHk9XMeXlCUR" /></figure><p>4. On the left of the window, you will see CheckStyle options to scan the current file (green run icon), Check Module and Check Project.</p><p>5. Select your preferred option and you will see the scanned results.</p><p>Now you are all set to experience the potential of CheckStyle!</p><h3>SpotBugs</h3><h4><strong>Installing and Configuring SpotBugs Plugin</strong></h4><p>Now let’s see how we can setup the SpotBugs Plugin.</p><ol><li>Follow the steps introduced previously for installing the SpotBugs plugin, either through the IntelliJ Marketplace or by <a href="https://plugins.jetbrains.com/plugin/14014-spotbugs">downloading</a>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WDvYaAcJ7QhJgi5n" /></figure><p>2. Navigate to Settings → Tools → SpotBugs</p><p>3. Click on the Report tab and set the following configurations:</p><pre>Analysis effort: Maximal<br>Minimum confidence: Low</pre><p>Note: This setting is recommended if you are performing a thorough security audit or critical code review. This will enhance the analysis by increasing precision and uncovering more bugs. For general development, the default settings suffice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iZwOI4XXLHPRm-OQ" /></figure><h4><strong>Using the </strong>SpotBugs <strong>Plugin</strong></h4><ol><li>Open or create a Java project.</li><li>On the bottom-left corner, click on the SpotBugs icon.</li><li>On the left of the window, you will see SpotBugs options to analyse the current file, Analyse Packages and Project Files, and more.</li><li>Select your preferred option and you will see the scanned results.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CcAIMMD5iB65H1mr" /></figure><h4><strong>Installing the Find Security Bugs Add-On</strong></h4><p>The Find Security Bugs add-on extends SpotBugs’ capabilities to detect security vulnerabilities in Java web applications, making it an essential tool for security audits.</p><ol><li>Navigate to Settings → Tools → SpotBugs.</li><li>In the General tab, click the + icon under Plugins.</li><li>Select <em>Add Find Security Bugs</em>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VXs_ofjJ-uW2cl2A" /></figure><h4><strong>Using the Find Security Bugs</strong> Add-On</h4><ol><li>Click on an option to analyse the project files under the SpotBugs icon found on the bottom-left corner.</li><li>You will see an extra scanned result listing security bugs.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uO1rmwhrh5dmFs-X" /></figure><p>Now you have powered up your development environment with two influential plugins. Explore the plugins further to discover their full potential!</p><h4>References</h4><p>[1] <a href="https://somindagamage.medium.com/how-to-configure-checkstyle-and-findbugs-plugins-to-intellij-idea-38148aad2387">https://somindagamage.medium.com/how-to-configure-checkstyle-and-findbugs-plugins-to-intellij-idea-38148aad2387</a></p><p>[2] <a href="https://github.com/find-sec-bugs/find-sec-bugs/wiki/IntelliJ-Tutorial">https://github.com/find-sec-bugs/find-sec-bugs/wiki/IntelliJ-Tutorial</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3275b9088add" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential IntelliJ IDEA Plugins to Simplify and Enhance Your Developer Life]]></title>
            <link>https://yoshani-malinka.medium.com/essential-intellij-idea-plugins-to-simplify-and-enhance-your-developer-life-60427a7599a8?source=rss-857dd675292d------2</link>
            <guid isPermaLink="false">https://medium.com/p/60427a7599a8</guid>
            <category><![CDATA[intellij-plugin]]></category>
            <category><![CDATA[code-quality]]></category>
            <category><![CDATA[clean-code]]></category>
            <dc:creator><![CDATA[Yoshani Ranaweera]]></dc:creator>
            <pubDate>Mon, 09 Dec 2024 04:27:17 GMT</pubDate>
            <atom:updated>2024-12-13T06:34:59.806Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MkQuNd8Ni4RRKaxNqWqjNA.jpeg" /><figcaption><a href="https://www.freepik.com/free-photos-vectors/developer-wallpaper">Source</a></figcaption></figure><p>IntelliJ IDEA’s plugin ecosystem offers powerful tools to enhance productivity, maintain code quality, and improve development efficiency. Listed below are some of the must-have plugins that will boost your development workflow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*FOvEYJ20Rzn-M5SkwN1GJw.png" /></figure><h4><strong>1. SonarQube (formerly SonarLint)</strong></h4><p>SonarQube is a real-time code analysis plugin designed to ensure code quality. It flags coding issues in real-time, providing instant feedback on bugs and vulnerabilities. Additionally, it offers contextual assistance to comprehend why an issue was flagged and to assess the risk. It then suggests methods that can be adopted to fix it, thus enhancing productivity and skill. It enables teams to enforce strict coding standards, helping them produce Clean Code. SonarQube is free to use and integrates seamlessly into IntelliJ IDEA, providing valuable insights as you type.</p><p>Features:</p><ul><li>Identifies bugs, security vulnerabilities, and code smells.</li><li>Delivers rich contextual guidance, detailed issue explanations and suggested fixes.</li><li>Supports multiple programming languages.</li></ul><p>Link: <a href="https://plugins.jetbrains.com/plugin/7973-sonarqube-for-ide">SonarQube Plugin</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*mbDYCOBxh4IcytEEvJ24qg.png" /></figure><h4><strong>2. CheckStyle-IDEA</strong></h4><p>CheckStyle-IDEA is an essential plugin for Java developers to ensure code quality. It is a linter that highlights violations in code style in IntelliJ IDEA, enforcing consistent coding standards. Developers can use predefined configurations like Google or Sun standards or define custom rules to maintain clean, readable, and maintainable code. The plugin is available free of charge and does not require a license.</p><p>Features:</p><ul><li>Real-time and on-demand highlighting of coding standard violations.</li><li>Flexible configuration for custom coding rules.</li><li>Supports batch and single file analysis.</li></ul><p>Link: <a href="https://plugins.jetbrains.com/plugin/1065-checkstyle-idea">CheckStyle-IDEA Plugin</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*lTUM4hKxZ5dScJqpSIuqFw.png" /></figure><h4><strong>3. SpotBugs (&amp; Find Security Bugs)</strong></h4><p>SpotBugs is a static byte code analysis tool focused on Java code, ensuring code quality by detecting bugs, performance issues, and potential vulnerabilities. Its Find Security Bugs add-on extends its capabilities to identify security vulnerabilities in your application. The plugin is freely available for use.</p><p>Features:</p><ul><li>Detects common Java bugs and performance issues.</li><li>Highlights security vulnerabilities using the Find Security Bugs add-on.</li></ul><p>Link: <a href="https://plugins.jetbrains.com/plugin/14014-spotbugs">SpotBugs Plugin</a></p><p>Add-on: <a href="https://find-sec-bugs.github.io/download.htm">Find Security Bugs</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/162/1*GYUjmI9qZM3fZ8vj9Kgiig.png" /></figure><h4><strong>4. GitHub Copilot</strong></h4><p><a href="https://github.com/features/copilot">GitHub Copilot</a> is an AI-driven coding assistant that enhances productivity by offering intelligent code suggestions. It analyzes code and provides autocompletions, boilerplate code, and even supports natural language comments, converting comments to code. It also provides a chat feature where you can ask coding-specific queries and receive explanations, code refactor suggestions, and much more. GitHub Copilot works on any programming language, helping accelerate development and improve code quality. It is a paid plugin with a subscription model.</p><p>Features:</p><ul><li>Context-aware code suggestions and completions.</li><li>Supports natural language comments.</li><li>Compatible with a wide range of programming languages and frameworks.</li><li>Reduces repetitive coding tasks.</li><li>Offers its services through both code completions and chat.</li></ul><p>Link: <a href="https://plugins.jetbrains.com/plugin/17718-github-copilot">GitHub Copilot Plugin</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*I9LrWlIJbrLkx7dhSxZr-Q.png" /></figure><h4><strong>5. ESLint</strong></h4><p>ESLint is a powerful static analysis tool designed for JavaScript and TypeScript developers to ensure code quality. It detects and warns of coding errors in the editor as you type, enforcing coding standards and ensuring quality. The linting scope can be configured to apply to files of different types across the entire project or specific parts of it. This plugin is particularly useful for front-end developers, especially those working on IAM portals. ESLint is available for free.</p><p>Features:</p><ul><li>Detects errors and enforces best practices.</li><li>Supports auto-fixing of issues.</li><li>Allows for customisable linting scope.</li></ul><p>Link: <a href="https://plugins.jetbrains.com/plugin/7494-eslint">ESLint Plugin</a></p><p>Here is a summarised table of all the things we’ve discussed so far:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TstlCqSeegsvLTKKu9--0A.png" /></figure><p>These plugins cater to various development needs and help maintain high standards in code quality, productivity, and security. Integrate them into your IntelliJ IDEA to optimize your workflow!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=60427a7599a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing API Resources with WSO2 Identity Server]]></title>
            <link>https://medium.com/identity-beyond-borders/securing-api-resources-with-wso2-identity-server-013bfaae26c9?source=rss-857dd675292d------2</link>
            <guid isPermaLink="false">https://medium.com/p/013bfaae26c9</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[secure-api]]></category>
            <category><![CDATA[wso2is]]></category>
            <dc:creator><![CDATA[Yoshani Ranaweera]]></dc:creator>
            <pubDate>Thu, 13 Jun 2024 04:04:30 GMT</pubDate>
            <atom:updated>2025-04-04T08:11:18.128Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5sbCS9VrWB4Y1ABGLWSrZg.png" /></figure><p>The <a href="https://wso2.com/identity-server/">latest version</a> of WSO2 Identity Server makes securing your API resources easier than ever!</p><p>In this article, we are going to familiarize ourselves with 4 primary terms, API resources, Permissions, Groups and Roles.</p><p><strong>API resource</strong> — An API resource is a specific endpoint or service exposed by an API that represents a collection of data or a functionality. When it comes to WSO2 Identity Server, API resources can be either business APIs for providing business functionalities, or management/organization APIs for providing administrative functionalities. An API resource is associated with a set of permissions defining the actions that can be performed on it.</p><p>Example: In an e-library application, an API resource could be <strong><em>/books</em></strong>, and actions such as <strong><em>read</em>,<em> create</em>,<em> update</em></strong>,<em> </em>and<em> </em><strong><em>delete</em></strong> might be performed on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/213/1*S2odaLyzkKGNQkT94kSipQ.png" /><figcaption>Source: <a href="https://www.codewithmmak.com/blog/api-testing-demo-site/">Internet</a></figcaption></figure><p><strong>Permission</strong> — A permission, also termed scopes, are definitive actions that can be performed on a resource. Each permission represents a specific operation that an application can perform on behalf of a user.</p><p>Example: For the <strong><em>/books</em></strong> API, associated permissions might be <strong><em>books:read</em></strong>,<em> </em><strong><em>books:create</em></strong>, <strong><em>books:update</em></strong>,<em> </em>and<em> </em><strong><em>books:delete</em></strong>. For an application to perform these actions on behalf of a user, it must obtain an authorized token.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/268/1*ka7VCGPntHbj0kyXek72pQ.png" /><figcaption>Source: <a href="https://www.pngwing.com/en/free-png-vhkzg">Internet</a></figcaption></figure><p><strong>Role</strong> — A role is a named collection of permissions assigned to users or groups to simplify access management. Rather than assigning permissions individually to users, roles make it easier by housing a common set of permissions that may be required by different actors of the system for performing functions. WSO2 IS allows both application-specific roles and organization-wide roles.</p><p>Example: In the e-library application, associated roles could be <strong>Book Manager</strong> and <strong>Reader</strong>. A book manager’s role may include all permissions such as <strong><em>viewBooks</em></strong>, <strong><em>addBooks</em></strong>, <strong><em>updateBooks</em></strong> and <strong><em>deleteBooks</em></strong>, while a normal Reader may only be granted the <strong><em>viewBooks</em></strong> permission.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/170/1*9mqh_Jja2zNNJV-ul0AZrA.png" /><figcaption>Source: <a href="https://www.clipartkey.com/view/JRwJRm_businessman-clipart-png-business-man-icon/">Internet</a></figcaption></figure><p><strong>Group</strong> — A user group is a named collection of users who share the same access rights or privileges. Groups make administrative tasks more efficient as roles or permissions can be assigned to users at a higher grouped level rather than individually. Groups typically reflect the organizational structure.</p><p>Example: In the e-library application, user groups might include <strong>Library Staff</strong> and <strong>Members</strong>. Some of the users in Library Staff can be assigned the Book Manager role, while all of the Members will be assigned the Reader role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*PDTUWdkSJ1J9YDxWa7cGug.png" /><figcaption>Source: <a href="https://www.avamigratron.com/Product/gsuite-migration-v1/png-clipart-computer-icons-users-group-google-groups-henna-gruop/">Internet</a></figcaption></figure><p>Suppose you are the owner of a trading company which uses WSO2 IS as its IAM solution. You have an online application where you advertise your products, and you want a set of your employees (the product management team) to handle all operations related to managing the site, such as creating, updating and deleting products. Other employees and customers can only view the products. You do not want any other employee to be able to do any such app-related management operation. You have developed an API, say Product Management API, for handling these tasks.</p><p>For this tutorial, let’s use the React SPA sample application provided by WSO2.</p><h4><strong>Prerequisites</strong></h4><p>Create a user (or users) on IS to act as your company’s product managers.</p><h4><strong>Step 1: Create a SPA named Product Manager.</strong></h4><p>You can follow the <a href="https://is.docs.wso2.com/en/latest/get-started/try-samples/qsg-spa-react/">WSO2 documentation</a> for creating and setting up the sample application.</p><h4><strong>Step 2: Create the API Resource</strong></h4><ol><li>Navigate to API Resources section.</li></ol><blockquote>Note: In WSO2 IS 7.0, all readily available API resources related to the server can be found in the Management APIs and Organization APIs tabs under API Resources section.</blockquote><p>2. Click on New API Resource.</p><p>3. Add a unique identifier and provide <strong>Product Management API</strong> as the display name. Click Next.</p><p>4. Add the four scopes <em>product_view</em>, <em>product_create</em>, <em>product_update</em> and <em>product_delete</em>.</p><p>5. Click Next, and click Create.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e3zkHuXAgWv_2s3MfSO31A.png" /></figure><h4><strong>Step 3: Authorize the API to the application</strong></h4><ol><li>Go to the created application in the IS console and click on the API Authorization tab.</li><li>Click on Authorize an API Resource button</li><li>From the API Resource dropdown, select Product Management API</li><li>Select all the scopes under the API</li><li>Click Finish</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3RcGaVfQ3bll1uHxQIqo0w.png" /></figure><p>Now your application is authorized to perform actions on this API.</p><h4><strong>Step 4: Create an application role</strong></h4><ol><li>In the created application, go to the Roles tab</li><li>You can see that by default this application can be associated with application roles. Click on New Role to create an application role.</li><li>For the role name enter product_manager</li><li>Select the Product Management API for the API Resource associated with the role.</li><li>Select all permissions (scopes)</li><li>Click create</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MM_01VqXeShlI2E9jrUW2Q.png" /></figure><h4><strong>Step 5: Create a group and assign the roles</strong></h4><p>You may omit this step by assigning the role directly to all your application manager users, but when you want to do changes to the role permissions, or even assign multiple roles for these users in future, having a group will make things much easier.</p><ol><li>Navigate to User Management &gt; Groups</li><li>Click on New Group</li><li>Enter manger as the Group name</li><li>In the Add Users section, select all your product manager users</li><li>Click Next</li><li>Assign the product_manager role to this group</li><li>Click Finish</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khMW4j5RjUar7Sm3cftigg.png" /></figure><h4><strong>Step 6: Update the requested scopes in your react application</strong></h4><ol><li>Navigate to your SPA from the Applications section</li><li>From the API Authorization section, copy the scopes authorized to this application</li></ol><p>3. In your sample application, open the config.json file and update the scopes section with the above scopes.</p><pre>{<br>&quot;clientID&quot;: &quot;qlfMw97tNz9dJF2NaRHXQOs_2zca&quot;,<br>&quot;baseUrl&quot;: &quot;https://localhost:9453&quot;,<br>&quot;signInRedirectURL&quot;: &quot;https://localhost:3000&quot;,<br>&quot;signOutRedirectURL&quot;: &quot;https://localhost:3000&quot;,<br>&quot;scope&quot;: [&quot;profile product_create product_update product_view product_delete&quot;]<br>}</pre><p>Now your Product Manager application is ready for your managers to use!</p><p>Try logging into the application with your app manager user. You will be able to see the product management scopes returned in the access token (you can obtain the token by inspecting the Network tab of your browser). Your users can use this token to perform product management operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XtJULOJlcRRI4wJDHyS0Zg.png" /></figure><p>Also, try logging in with a different user not assigned to the group and see that these scopes are not returned, hence preventing unauthorized access to your API Resource.</p><p>That’s it for this article😀. Hope you enjoyed it!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=013bfaae26c9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/identity-beyond-borders/securing-api-resources-with-wso2-identity-server-013bfaae26c9">Securing API Resources with WSO2 Identity Server</a> was originally published in <a href="https://medium.com/identity-beyond-borders">Identity Beyond Borders</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering the Art of Variable Naming: Tips for Meaningful and Maintainable Code]]></title>
            <link>https://yoshani-malinka.medium.com/mastering-the-art-of-variable-naming-tips-for-meaningful-and-maintainable-code-7d9f0df5351d?source=rss-857dd675292d------2</link>
            <guid isPermaLink="false">https://medium.com/p/7d9f0df5351d</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[variable-names]]></category>
            <dc:creator><![CDATA[Yoshani Ranaweera]]></dc:creator>
            <pubDate>Sun, 04 Feb 2024 14:49:36 GMT</pubDate>
            <atom:updated>2024-02-04T14:52:52.690Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*acBRzch312d9IwAK" /><figcaption>Photo by <a href="https://unsplash.com/@lucabravo?utm_source=medium&amp;utm_medium=referral">Luca Bravo</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>As professional developers, it is of utmost importance to choose the right names for your variables when coding. Why? Because this is a fundamental point that makes up the distinction between just a developer who writes code to get something done and a professional who writes code that gets the thing done while also having a level of comprehensibility that another can easily grasp what it does by reading it.</p><p>So, how exactly do you choose a good name? That’s what we are going to uncover in this article!</p><h4>Intent</h4><p>The name that you choose should clearly convey the intention of the variable. It should answer why it was introduced, what it is supposed to do, and how it will be used.</p><p>Imagine you’re writing code for a program that calculates the area of a rectangle. You need to define two variables to store the length and width of the rectangle. You can do it in two ways:</p><p><strong>Option 1: Using unclear variable names:</strong></p><pre>double x;<br>double y;</pre><p><strong>Option 2: Using clear variable names:</strong></p><pre>double length;<br>double width;</pre><p>Obviously the second method at a glance makes it evident that these are the dimensions of the rectangle. Using variable names that convey intent helps anyone reading the code understand the purpose and use of the variables without needing additional comments or guesswork.</p><h4>Distinction</h4><p>When you face a situation where you need two different names for two things in the same scope, you are tempted to change one of them in an arbitrary manner. This can be by misspelling, or adding some random letters. But the thing that you should keep in mind is that if you need two variables, they should represent different things.</p><p>Avoid number series naming conventions such as a1, a2, …, aN, they inherently do not convey any information regarding the variable.</p><p>Avoid noise words unless they make a purposeful difference. For example, EmployeeInfo and Employee may form two different names but there is no distinction between the two.</p><h4>Pronounceability</h4><p>Make sure that whatever name you come up with is easily pronounceable! That being said, think of a variable name like “cssps” to mean customer satisfaction score per survey. Apart from the name itself revealing nothing about its intent, you certainly cannot pronounce it properly, be it a conversation with your colleague or a code review session. Readers of your code will form different pronunciations for this variable in their minds, one might read it in individual letters, and another might simply say something like “cuss pss”. This will clearly put everyone in a complex situation in any kind of conversation.</p><p>Instead, you should use a pronounceable variable name, say “customerSatisfactionScorePerSurvey”, simple as that!</p><h4>Searchability</h4><p>A variable name should be easily searchable. For example, a search for single-letter names and numeric constants may result in thousands of unrelated results, however a good variable name such as “customerSatisfactionScorePerSurvey” can be easily located. Although programmers commonly use single-lettered variables like <em>i</em>, it is extremely difficult to find this in a search result. Thus, if you must, the golden rule here is that such variable names should only be used inside short scopes as local variables.</p><h4>Concept</h4><p>It is important to have the same word to describe a specific concept. For instance, interchangeably using the terms “count”, “sum” and “total” for quantifier variables, say “responseCount” and “responseTotal”, within the same codebase leads to confusion. The reader would expect these variables to somehow represent distinct concepts, when in reality they were used for the same purpose.</p><p>If you abide by these ideas when naming your variables, you will end up with a pretty good name which will be praised by all developers and readers to follow!</p><p>This article references the awesome book <em>“Clean Code: A Handbook of Agile Software Craftsmanship”</em> by Robert C. Martin. Do give it a read if you want to know in depth about what I have covered here, and much more!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7d9f0df5351d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Try Pushed Authorization Requests (PAR) in Asgardeo]]></title>
            <link>https://yoshani-malinka.medium.com/try-pushed-authorization-requests-par-in-asgardeo-dbabd9606806?source=rss-857dd675292d------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbabd9606806</guid>
            <category><![CDATA[identity]]></category>
            <category><![CDATA[oauth2]]></category>
            <dc:creator><![CDATA[Yoshani Ranaweera]]></dc:creator>
            <pubDate>Sat, 07 Oct 2023 10:25:10 GMT</pubDate>
            <atom:updated>2023-10-07T10:25:10.332Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/840/0*AiKG51QdnzA0EQCS.png" /></figure><p>In conventional authorization requests, we generally send the request through the front-channel. Thus, all the request attributes that need to be sent will be sent directly through the web browser. In contrast, in pushed authorization requests, we push the payload of the authorization request directly to the authorization server, and we get a reference to that, called a request_uri, in return. So in the subsequent authorization request we can use this request_uri to get the relevant payload. All the client authentication rules of the token endpoint apply to the PAR endpoint as well.</p><p>Some of the many advantages of PAR over traditional authorization requests are:</p><ul><li><strong>Enhanced Security</strong>: Integrity and authenticity of authorization requests ensured by preventing modifications to parameters.</li><li><strong>Confidentiality Assurance</strong>: Safeguards request parameter confidentiality, preventing inadvertent data exposure in query strings to web server logs and other sites.</li><li><strong>Optimized Request Size</strong>: Mitigates potential issues arising from large request sizes, ensuring smoother request processing.</li></ul><p>Let’s look at the PAR flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XlYIbpdYtuHssYPc" /><figcaption>Source: <a href="https://wso2.com/asgardeo/docs/references/pushed-authorization-requests/#how-does-it-work">Asgardeo Docs</a></figcaption></figure><p>1. The client makes a POST request to the `/par` endpoint comprising all the parameters required for authorization.</p><pre>curl --location &#39;https://api.asgardeo.io/t/{organization_name}/oauth2/par&#39; \<br>    --header &#39;Content-Type: application/x-www-form-urlencoded&#39; \<br>    --header &#39;accept: application/json&#39; \<br>    --header &#39;Authorization: Basic -u {CLIENT_ID}:{CLIENT_SECRET}&#39; \<br>    --data-urlencode &#39;client_id={CLIENT_ID}&#39;\<br>    --data-urlencode &#39;redirect_uri={REDIRECT_URI}&#39; \<br>    --data-urlencode &#39;response_type=code&#39; \<br>    --data-urlencode &#39;scope=&lt;SCOPES&gt;&#39;</pre><p>2. The client is authenticated by the authorization server.</p><p>3. The pushed authorization request is validated.</p><p>4. If the validation is successful, the endpoint returns a response containing the request_uri.</p><p>5. The client makes an authorization request containing the client_id and the request_uri to the authorization endpoint.</p><pre>https://api.asgardeo.io/t/{organization_name}/oauth2/authorize?<br>client_id={CLIENT_ID}&amp;request_uri={request_uri}</pre><p>6. The authorization request is validated.</p><p>7. If the validation is successful, the client receives the authorization code (or the access token based on the chosen grant type).</p><p>Now let’s try this in Asgardeo.</p><p>Before you begin, <a href="https://wso2.com/asgardeo/docs/guides/applications/register-oidc-web-app/">create an application</a> in Asgardeo. Note the client id of the application.</p><p>It’s time to get a request uri. Initiate a POST request to the endpoint <a href="https://api.asgardeo.io/t/%7Borganization_name%7D/oauth2/par">https://api.asgardeo.io/t/{organization_name}/oauth2/par</a> passing all the usual authorization request parameters in the request body.</p><pre>curl --location &#39;https://api.asgardeo.io/t/yoshani/oauth2/par&#39; \<br>    --header &#39;Content-Type: application/x-www-form-urlencoded&#39; \<br>    --header &#39;accept: application/json&#39; \<br>    --header &#39;Authorization: Basic -u YWRtaW46YWRtaW4=&#39; \<br>    --data-urlencode &#39;client_id=DUBCMGolTZQNg6mmE9GvfQ3qfq8a&#39; \<br>    --data-urlencode &#39;redirect_uri=http://localhost:8080/playground2&#39; \<br>    --data-urlencode &#39;response_type=code&#39; \<br>    --data-urlencode &#39;scope=openid email&#39;</pre><p>You will receive a response containing the request_uri and an expiry time. The request_uri expires in 1 minute.</p><pre>{<br>&quot;expires_in&quot;: 60,<br>&quot;request_uri&quot;: &quot;urn:ietf:params:oauth:par:request_uri:a0cf571e-fe97-411a-8f33-3c01913c0e5f&quot;<br>}</pre><p>Now, you just have to use this request_uri instead of all the other authorization request parameters in the authorization request. The only additional parameter you should send is the client id.</p><pre>https://api.asgardeo.io/t/yoshani/oauth2/authorize?<br>client_id=DUBCMGolTZQNg6mmE9GvfQ3qfq8a<br>&amp;request_uri=urn:ietf:params:oauth:par:request_uri:a0cf571e-fe97-411a-8f33-3c01913c0e5f</pre><p>At the backend, the request parameters that are referenced by the request_uri will be fetched, and the normal authorization flow will continue.</p><p>You have successfully tried authorization using pushed authorization requests. For more details about the concept, visit the <a href="https://datatracker.ietf.org/doc/html/rfc9126">specification</a>.</p><h4>References</h4><p>[1] <a href="https://wso2.com/asgardeo/docs/references/pushed-authorization-requests/">https://wso2.com/asgardeo/docs/references/pushed-authorization-requests</a></p><p>[2] <a href="https://wso2.com/asgardeo/docs/guides/authentication/oidc/implement-login-with-par/">https://wso2.com/asgardeo/docs/guides/authentication/oidc/implement-login-with-par</a></p><p>[3] <a href="https://datatracker.ietf.org/doc/html/rfc9126">https://datatracker.ietf.org/doc/html/rfc9126</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbabd9606806" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing the Digital Frontier: The Power of Continuous Authentication]]></title>
            <link>https://yoshani-malinka.medium.com/securing-the-digital-frontier-the-power-of-continuous-authentication-5fe0b1ae53d?source=rss-857dd675292d------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fe0b1ae53d</guid>
            <category><![CDATA[continuous-authentication]]></category>
            <dc:creator><![CDATA[Yoshani Ranaweera]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 16:56:25 GMT</pubDate>
            <atom:updated>2023-06-29T03:42:21.872Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/450/1*yHqoiUZWFkJggi39qhNR8g.png" /><figcaption><a href="https://swoopnow.com/user-authentication/">Source</a></figcaption></figure><p>In today’s world where technology keeps enhancing, ensuring robust security measures is of utmost importance. With the advancement of technology, cyber threats have also become more prominent, proving that traditional authentication methods are no longer adequate. Continuous authentication, a revolutionising approach for dynamically verifying and validating user identities has caught the attention of many identity experts. In this article, I will walk you through the world of continuous authentication, and by the end of it you will have a good understanding of this approach.</p><p>Before diving in, let’s take a step back and analyse why traditional authentication methods are no longer sufficient to satisfy the security needs of the present day world. Authentication in the current day still heavily depends on passwords. For a password to be kept safe, users should not use either easily guessable ones or reuse the same password across multiple sites. But this is exactly what most users would do, because who can remember hundreds of passwords, added that they don’t even make sense? Also, the username and password duo is highly vulnerable to phishing attacks. With traditional methods, we naturally trust that once the user is successfully authenticated, then the “real” user is fully safe. There’s no way to detect whether the account has been taken over by someone else midway during the user session. Thus, the big question:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*u2QdtZwEcRBd00cfclm2Bg.png" /></figure><blockquote>Is initial authentication actually enough to trust that the legitimate user’s account is secure?</blockquote><p>Even after highly secure methods of initial authentication, like fingerprints or facial recognition, what if the user leaves their workstation while the user session has not terminated yet, and a malicious user takes over? How are we to address this situation with traditional authentication alone?</p><p>Enter continuous authentication, which revolves around the concept of continually verifying the user identity throughout the entire user session from login through logout. It starts with traditional authentication, but doesn’t stop there. It continues the verification process in real-time.</p><p>How do we achieve this?</p><p>We start with traditional authentication to give user access. After successful authentication, the user’s behaviour is monitored to build a rich profile of “normal” behaviours. This profile is used as a baseline to measure future activity, and to calculate a risk score. Based on this score, anomalies are flagged and authentication decisions and adaptive responses are taken.</p><p>Following are example user data points that can be measured to build the standard profile.</p><p>1. <strong>Real-time monitoring and analysis</strong></p><p>Behavioural biometrics — movement patterns, typing speeds and patterns, keystroke dynamics, screen swipes</p><p>2. <strong>Dynamic authentication factors</strong></p><p>Contextual factors — user’s location, time of access, IP address, device information, browser activity, geographic device posture, network behaviour</p><p>Physiological biometrics— fingerprints, facial recognition, voice recognition, iris scanning</p><p>Let’s look at an example user story to grasp this concept better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*rApoohqRTmQEsONny9lDOQ.png" /><figcaption><a href="https://journeyid.com/products/continuous-authentication/">Source</a></figcaption></figure><p>Daphne is an employee of a finance company that utilises continuous authentication in their system. It has recorded the following user profile about Daphne.</p><ul><li>Usually signs into the system between 8 am and 5 pm.</li><li>Is almost always located in Colombo and is rarely outside of the Western Province</li><li>Rarely fails a login attempt</li></ul><p>One day, the server notices that Daphne signs in from Jaffna, 10 minutes after she signed in from Colombo. Also, she fails the first two login attempts and is successful on the third.</p><p>According to continuous authentication rules, this is flagged as an anomaly and the account is blocked.</p><p>It is clear that continuous authentication provides a much better layer of security than traditional one-time authentication. It can be used to achieve better user experience and convenience owing to the fact that the authentication actions can be carried out in the background until something is deemed suspicious. Also, it provides adaptability to different user contexts.</p><p>By now, I hope you have got a good understanding on the concept of continuous authentication.</p><p>The specifications CAEP and RISC currently being developed by the OpenID Foundation strongly aligns on the concept of continuous authentication. Refer [4] if you are interested to learn more about these specs.</p><p>Have a good day! <strong>😊</strong></p><p><strong>References</strong></p><p>[1] <a href="https://www.pingidentity.com/en/resources/identity-fundamentals/authentication/continuous-authentication.html">https://www.pingidentity.com/en/resources/identity-fundamentals/authentication/continuous-authentication.html</a></p><p>[2] <a href="https://blog.typingdna.com/continuous-authentication-how-it-works-use-cases-and-industries/">https://blog.typingdna.com/continuous-authentication-how-it-works-use-cases-and-industries/</a></p><p>[3] <a href="https://www.okta.com/blog/2020/06/the-path-to-continuous-authentication-solving-the-best-of-breed-problem/">https://www.okta.com/blog/2020/06/the-path-to-continuous-authentication-solving-the-best-of-breed-problem/</a></p><p>[4] <a href="https://openid.net/wg/sharedsignals/">https://openid.net/wg/sharedsignals/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fe0b1ae53d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SCIM 2.0 API in WSO2 Identity Server with OAuth Bearer Token-based Authentication ]]></title>
            <link>https://yoshani-malinka.medium.com/try-scim-2-0-api-with-wso2-identity-server-43c232ab9daa?source=rss-857dd675292d------2</link>
            <guid isPermaLink="false">https://medium.com/p/43c232ab9daa</guid>
            <dc:creator><![CDATA[Yoshani Ranaweera]]></dc:creator>
            <pubDate>Sun, 12 Mar 2023 17:34:31 GMT</pubDate>
            <atom:updated>2025-01-08T04:45:13.816Z</atom:updated>
            <content:encoded><![CDATA[<p>The System for Cross-domain Identity Management (SCIM) is a RESTful API for managing users and groups. It is intended for reducing the cost and complexity of user management operations. SCIM 2.0 uses an object model for transferring data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/0*t3NsB0odpmvaLsS6" /><figcaption>Source: <a href="https://twitter.com/wso2/status/885789913798422529">WSO2 on Twitter</a></figcaption></figure><p>WSO2 Identity Server supports SCIM 2.0 and has the capability to do various user management tasks using the SCIM 2.0 API. You can read more about this in the <a href="https://is.docs.wso2.com/en/latest/apis/scim2-rest-apis/">documentation</a>.</p><p>We’ll go through one of the endpoints to see how we can use the API in WSO2 IS. Before you begin, make sure you have an up and running instance of a WSO2 IS pack.</p><p>We can call the SCIM2 API with either of the following authentication methods:</p><ol><li>Using basic auth (username and password)</li><li>Using bearer token (an access token)</li></ol><p>To understand the flows, let’s try the SCIM2/Me Endpoint Get operation by bearer token method. This API can be used to manage the currently authenticated user.</p><p>And let’s begin!</p><p>Note: This guide is written based on WSO2 IS 6.1.0 pack and will be using the legacy Management Console.</p><h3>✅ Create a user with the required permissions</h3><ol><li>In Home &gt; Identity &gt; Users and Roles, click Add</li><li>Click Add New User</li><li>Enter a suitable name and password and click Finish</li><li>In the same, click Add New Role</li><li>Give a suitable role name like supervisor and click Finish</li><li>In Roles, under the created role, click Permissions</li></ol><blockquote><strong>To use the SCIM API, there are specific permissions that the user needs to have. These can be found in the </strong><a href="https://is.docs.wso2.com/en/latest/apis/scim2-rest-apis/#/Me%20Endpoint/get_Me"><strong>documentation</strong></a><strong>. To use the SCIM2/Me Get endpoint, the “login” permission is required.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*lX3SeKIcfjnydiQg9VJTZQ.png" /><figcaption>Source: <a href="https://is.docs.wso2.com/en/latest/apis/scim2-rest-apis/#/Me%20Endpoint/get_Me">WSO2 IS Documentation</a></figcaption></figure><p>7. In the Permissions page, follow the path <em>/permission/admin/login</em> to get to the required permission, check the required permission and update. (All permissions &gt; Admin Permissions &gt; Login)</p><p>8. In the users list, click Assign Roles for the created user and assign the supervisor role and click finish.</p><h3>✅ Register a Service Provider</h3><ol><li>Navigate to the IS console</li><li>Under Home &gt; Identity &gt; Service Providers click Add</li><li>Give the Service Provider Name as “scim-test”</li><li>Under Inbound Authentication Configuration click Configure in OAuth/OpenID Connect Configuration</li><li>Make sure that “code” and “refresh_token” grant types are enabled</li><li>Add a callback URL (eg: <a href="http://localhost:4200/">http://localhost:4200</a>)</li><li>Click Add at the bottom of the page</li><li>Note the OAuth Client Key and Client Secret</li></ol><h3>✅ Generate the authorization code</h3><p>To get the access token, we’ll be using the authorization code grant. But feel free to generate it using any other grant type as you wish.</p><ol><li>In your browser, enter the following request with the details mentioned to get an access token in return. Fill in the callback URL and client ID according to the Service Provider you registered.</li></ol><pre>https://localhost:9443/oauth2/authorize?response_type=code&amp;redirect_uri=&lt;callback_url&gt;&amp;client_id=&lt;client_id&gt;&amp;scope=&lt;scopes&gt;</pre><blockquote><strong>To use the SCIM2 API using a bearer token, the requested access token should have the necessary scopes that are needed to call that endpoint. The required scopes for SCIM2/Me Get operation can be found in the </strong><a href="https://is.docs.wso2.com/en/latest/apis/scim2-rest-apis/#/Me%20Endpoint/get_Me"><strong>documentation</strong></a><strong>. For this endpoint, we should request the scope “internal_login”.</strong></blockquote><p><strong>Sample request</strong></p><pre>https://localhost:9443/oauth2/authorize?response_type=code&amp;redirect_uri=http://localhost:4200&amp;client_id=KcdcoNq51Lq4d6c9oSv5P8BvL2Aa&amp;scope=internal_login</pre><p>2. When you enter this, you will be asked to enter your credentials. Here, login the credentials of the user you created.</p><p>3. Next, you will be prompted to give consent to the required permissions. Click Allow</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-NP0KyBOaxcEehOg" /></figure><p>4. Note down the authorization code visible in the address bar</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nj3QSc-QaAydACin" /></figure><h3>✅ Get the access token</h3><p>We can use the request format below to get an access token.</p><pre>curl -k -X POST https://localhost:9443/oauth2/token -H &#39;Content-Type: application/x-www-form-urlencoded&#39; -u &#39;&lt;client_id&gt;:&lt;client_secret&gt;&#39; -d &#39;grant_type=authorization_code&amp;code=&lt;authorization_code&gt;&amp;redirect_uri=&lt;callback_url&gt;&#39;</pre><p><strong>Sample request</strong></p><p>In a terminal or Postman, enter the following request. Fill in the values with those you obtained previously.</p><pre>curl -k -X POST https://localhost:9443/oauth2/token -H &#39;Content-Type: application/x-www-form-urlencoded&#39; -u &#39;KcdcoNq51Lq4d6c9oSv5P8BvL2Aa:FQBA1x_ekksvDuGnVUeLf1kJxUca&#39; -d &#39;grant_type=authorization_code&amp;code=111bf245-7ecf-3c32-ab67-0889c6ee2f44&amp;redirect_uri=http://localhost:4200&#39;</pre><p>You’ll get a response similar to the following. Here you can find the access token</p><pre>{<br>    &quot;access_token&quot;: &quot;7dd45247-ec4a-3357-b116-659df3b93401&quot;,<br>    &quot;refresh_token&quot;: &quot;b851e6ca-5525-32c8-8859-5529c9562f57&quot;,<br>    &quot;scope&quot;: &quot;internal_login&quot;,<br>    &quot;token_type&quot;: &quot;Bearer&quot;,<br>    &quot;expires_in&quot;: 3600<br>}</pre><h3>✅ Try SCIM2/Me Get operation</h3><p>In a terminal or Postman, enter the following request. Fill in the access token you received.</p><pre>curl -k -X GET &#39;https://localhost:9443/t/carbon.super/scim2/Me&#39; -H &#39;accept: application/scim+json&#39; -H &#39;Authorization: Bearer &lt;access_token&gt;&#39;</pre><p><strong>Sample request</strong></p><pre>curl -k -X GET &#39;https://localhost:9443/t/carbon.super/scim2/Me&#39; -H &#39;accept: application/scim+json&#39; -H &#39;Authorization: Bearer 7dd45247-ec4a-3357-b116-659df3b93401&#39; </pre><p>And there you go! You’ll get all the user information about the currently authenticated user.</p><pre>{<br>    &quot;emails&quot;: [<br>        &quot;miara@gmail.com&quot;<br>    ],<br>    &quot;meta&quot;: {<br>        &quot;created&quot;: &quot;2023-03-12T16:03:03.025489Z&quot;,<br>        &quot;location&quot;: &quot;https://localhost:9443/scim2/Users/60dc26c1-4062-421e-91c0-b3effa588c7b&quot;,<br>        &quot;lastModified&quot;: &quot;2023-03-12T16:59:40.466270Z&quot;,<br>        &quot;resourceType&quot;: &quot;User&quot;<br>    },<br>    &quot;schemas&quot;: [<br>        &quot;urn:ietf:params:scim:schemas:core:2.0:User&quot;,<br>        &quot;urn:ietf:params:scim:schemas:extension:enterprise:2.0:User&quot;<br>    ],<br>    &quot;roles&quot;: [<br>        {<br>            &quot;type&quot;: &quot;default&quot;,<br>            &quot;value&quot;: &quot;Internal/everyone,supervisor&quot;<br>        }<br>    ],<br>    &quot;name&quot;: {<br>        &quot;givenName&quot;: &quot;Miara&quot;,<br>        &quot;familyName&quot;: &quot;Waters&quot;<br>    },<br>    &quot;groups&quot;: [<br>        {<br>            &quot;display&quot;: &quot;supervisor&quot;,<br>            &quot;value&quot;: &quot;dc6b0ded-6eb1-4c32-ba40-160b2d172f46&quot;,<br>            &quot;$ref&quot;: &quot;https://localhost:9443/scim2/Groups/dc6b0ded-6eb1-4c32-ba40-160b2d172f46&quot;<br>        }<br>    ],<br>    &quot;id&quot;: &quot;60dc26c1-4062-421e-91c0-b3effa588c7b&quot;,<br>    &quot;userName&quot;: &quot;miara&quot;,<br>    &quot;urn:ietf:params:scim:schemas:extension:enterprise:2.0:User&quot;: {<br>        &quot;organization&quot;: &quot;WSO2&quot;<br>    }<br>}</pre><p>There are many other endpoints you can try out with SCIM2 API in WSO2 IS. Do try them out! <strong>😊</strong></p><h4>References</h4><p><a href="https://www.simplecloud.info/">https://www.simplecloud.info/</a></p><p><a href="https://medium.com/identity-beyond-borders/generating-access-tokens-using-wso2-identity-server-4d8c084a3bf5">https://medium.com/identity-beyond-borders/generating-access-tokens-using-wso2-identity-server-4d8c084a3bf5</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43c232ab9daa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Retrieving OIDC Claims with Federated Login in WSO2 IS ]]></title>
            <link>https://yoshani-malinka.medium.com/retrieving-oidc-claims-with-federated-login-in-wso2-is-288f5727bf52?source=rss-857dd675292d------2</link>
            <guid isPermaLink="false">https://medium.com/p/288f5727bf52</guid>
            <dc:creator><![CDATA[Yoshani Ranaweera]]></dc:creator>
            <pubDate>Tue, 21 Feb 2023 11:30:47 GMT</pubDate>
            <atom:updated>2023-03-13T07:59:09.296Z</atom:updated>
            <content:encoded><![CDATA[<p>Federated authentication is when a trusted third party is held responsible for authenticating an entity. As an example, imagine you have an application (the Service Provider) and you are using WSO2 IS (the Relying Party) for different IAM services for your app. For the ease of the users of your app, you want to provide an option for your users to login through Google. In this case, you should configure WSO2 IS to trust Google as an Identity Provider so that your users can login to the app using Google.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gpgHLBF72I-jnncxJqvoSg.png" /></figure><p>Well, that’s the whole point of identity federation, but once you are logged in, you want to show your users a My Account page where you display the user’s attributes such as name, email and profile picture. Hmm, what should you do now? Should you ask the user to enter all this stuff once they are authenticated? Your user wouldn’t prefer to enter all his details, right? Instead, what if we ask Google to send over the user’s attributes (which the user has already filled in Google, of course) over to your app once they are authenticated? That sounds a lot easier, right?</p><p>Well then, let’s see how we can achieve this task using OIDC claims. So, what are claims? A claim is an attribute related to a particular subject. For example, name, email and picture are claims of a user. When we want our client application registered in WSO2 IS to retrieve claims from a federated IdP like Google, we need to request those claims in a format that Google understands. Luckily for us, the OpenID Connect protocol has defined a set of <a href="https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims">standard claims</a> so that once configured, both WSO2 IS and Google knows which claim each other is referring to.</p><p>In the following example, let’s see how we can request the user’s profile picture from Google.</p><p>Before you begin, make sure you have an up and running instance of the latest WSO2 IS pack</p><p>Follow along!</p><h3>📌 <strong>Set up authentication for OIDC with Google</strong></h3><ol><li>Follow <a href="https://is.docs.wso2.com/en/latest/get-started/sample-use-cases/federated-authentication/#set-up-a-google-oauth-20-application">the guide</a> to set up authentication to use OIDC with Google</li><li>Note down the Client ID and Client Secret from the Credentials page.</li></ol><h3>📌 <strong>Register Google as a federated IdP in WSO2 IS</strong></h3><p>To better understand the use case, let’s register Google using OpenID Connect Configuration.</p><ol><li>Log in to the IS management console.</li><li>Navigate to Home &gt; Identity &gt; Identity Providers &gt; Add</li><li>Type in ‘Google’ as the name for the IdP</li><li>Expand Federated Authenticators &gt; OAuth2/OpenID Connect Configuration section and check Enable OAuth2/OpenIDConnect</li><li>Type in the Client ID and Client Secret you noted in the previous step</li><li>Add <a href="https://accounts.google.com/o/oauth2/v2/auth">https://accounts.google.com/o/oauth2/v2/auth</a> as the Authorization endpoint URL and <a href="https://oauth2.googleapis.com/token">https://oauth2.googleapis.com/token</a> as the Token endpoint URL</li><li>Click Register</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7F4yLZ5NDNDHXbid" /></figure><h3>📌 <strong>Register your application in IS</strong></h3><p>Now it’s time for you to register your application as a Service Provider.</p><ol><li>Navigate to Home &gt; Identity &gt; Service Providers &gt; Add</li><li>Fill in the name and click Register</li><li>Expand Inbound Authentication Configuration &gt; OAuth/OpenID Connect Configuration and click Configure</li><li>Add the Callback URL according to your application and click Add</li></ol><p><em>Hint: If you don’t have an application at hand, you can use </em><a href="https://is.docs.wso2.com/en/5.9.0/learn/deploying-the-sample-app/#deploying-the-pickup-dispatch-webapp"><em>this sample</em></a><em> provided by WSO2</em></p><p>Now it’s time for us to configure claims so that our client application can retrieve user attributes from Google once authenticated.</p><h3>📌 <strong>Request scopes in client application</strong></h3><p>In the OIDC protocol, claims have been categorized into buckets called <a href="https://openid.net/specs/openid-connect-core-1_0.html#ScopeClaims">scopes</a>. When requesting an access token, the client application should send in the required scopes to get access to the necessary claims.</p><p>The picture claim is included in the profile scope. If you are using the sample application, in the dispatch.properties file, edit the scope parameter as follows:</p><blockquote>scope=openid profile</blockquote><h3>📌 <strong>Request claims in Service Provider</strong></h3><ol><li>In your registered SP, expand Claim Configuration section</li><li>In Requested Claims click Add Claim URI and add the local claim for picture</li><li>Click update</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/0*dW7kkX1z5trTVq23" /></figure><h3>📌 <strong>Configure scopes in federated IdP</strong></h3><p>Now we need to configure scopes for the IdP so that the request sent to the IdP will contain the necessary scopes</p><ol><li>In your IdP edit page expand Federated Authenticators &gt; OAuth2/OpenID Connect Configuration</li><li>In the Scopes section append the scope profile and update</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/0*8IUEjakJu6IMtF7t" /></figure><p>That’s it!</p><p>Now try logging in to your application using Google</p><p>After logging in to your app using Google, you will see the following prompt asking for consent to share the picture with your app</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/0*k1p_l5-gE5IJn787" /></figure><p>Once consent is given, the retrieved ID token will contain the photo URL.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*k8PAEsiMrgbrI2OawbkDFQ.png" /></figure><p>Hope you enjoyed the article!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=288f5727bf52" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Asgardeo as the external OIDC IdP in WSO2 Identity Server ]]></title>
            <link>https://yoshani-malinka.medium.com/asgardeo-as-the-external-oidc-idp-in-wso2-identity-server-a2542ec95c0e?source=rss-857dd675292d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a2542ec95c0e</guid>
            <category><![CDATA[federated-identity]]></category>
            <category><![CDATA[oidc]]></category>
            <dc:creator><![CDATA[Yoshani Ranaweera]]></dc:creator>
            <pubDate>Fri, 30 Sep 2022 12:07:14 GMT</pubDate>
            <atom:updated>2023-03-13T08:00:58.470Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BKwQ7mKSmHFJqXi1944_7Q.png" /></figure><p>Have you ever used Google to login to an application? In this situation, we say that Google is the identity provider, since it provides the necessary identity information to authenticate you into the application. Just as so, we can use any external identity provider to log in to your application.</p><p>In this article, I’ll be using Asgardeo as the external identity provider to log in to an application registered in WSO2 Identity Server. In this scenario, WSO2 IS acts as the identity broker for your application, which we call a service provider.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NLZRk1TFGGPv4F2f" /></figure><p>Before you begin, make sure you have:</p><ol><li><a href="https://wso2.com/asgardeo/docs/get-started/create-asgardeo-account/#sign-up">An account in Asgardeo</a></li><li><a href="https://wso2.com/asgardeo/docs/get-started/create-asgardeo-account/#create-a-user">A user created in your organization</a></li><li>An up and running instance of <a href="https://wso2.com/identity-server/">WSO2 Identity Server</a></li></ol><p>Now that you are ready, the task at hand can be achieved using 4 very easy steps!</p><ol><li>Create the external IdP using Asgardeo</li><li>Register the external IdP in WSO2 IS</li><li>Register your application in WSO2 IS</li><li>Log in to your application using Asgardeo</li></ol><p>Let’s go through each step one by one.</p><h3><strong>Create the external IdP using Asgardeo</strong></h3><p>For our purpose, you need to register an OIDC application in Asgardeo, which will then act as the external identity provider.</p><ol><li>Log into the Asgardeo console</li><li>Navigate to Develop &gt; Applications</li><li>Click on New Application &gt; Traditional Web Application</li><li>In the wizard that appears, add a unique name, select OpenID Connect as the protocol, and set the authorized redirect URL. We will add <a href="https://localhost:9443/commonauth">https://localhost:9443/commonauth</a> since the identity broker is WSO2 IS (you can obtain this when you register your external IdP). Once done, click Register.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*USQkt3XFLSzsgFjr" /></figure><p>5. In the registered application, note down the following:</p><p><em>Client ID and Client Secret from the Protocol tab</em></p><p><em>Authorization endpoint, Token endpoint, and JWKS endpoint from the Info tab.</em></p><h3><strong>Register the external IdP in WSO2 IS</strong></h3><p>Now let’s register Asgardeo as an external identity provider in WSO2 IS.</p><ol><li>Log in to the IS management console.</li><li>In Home &gt; Identity &gt; Identity Providers and click Add.</li><li>Provide a name and fill in the JWKS Endpoint field using the information noted before</li><li>In the Federated Authenticators section, expand OAuth2/OpenID Connect Configuration section. Tick Enable OAuth2/OpenIDConnect, and fill in the rest of the information as noted before. Finally click Register.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/0*sUH7LYjiiD7ang2M" /></figure><h3><strong>Register your application in IS</strong></h3><p>Now it’s time for you to register your application as a Service Provider.</p><ol><li>Navigate to Home &gt; Identity &gt; Service Providers and register your application. You can refer to <a href="https://is.docs.wso2.com/en/latest/guides/login/webapp-oidc/">IS Documentation</a> to register the application as per your need.</li><li>In the registered application, expand Local &amp; Outbound Authentication Configuration, and select Federated Authentication. From the dropdown list, select the IdP you registered before. Click Update.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/749/0*DmYGufG5PacgDCW0" /></figure><p>Now that all the configurations are done, it’s finally showtime.</p><h3><strong>Log in to your application using Asgardeo</strong></h3><ol><li>Go to the access URL of your application</li><li>Once you click login, you will be redirected to the Asgardeo login page</li><li>Enter the credentials for the user you created in Asgardeo and click Sign in</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/517/0*R7p00qNS-iC_vcNd" /></figure><p>Voilà! You have successfully logged in to your application using Asgardeo as the external identity provider.</p><p><em>*********************************************************************</em></p><p>There are many more cool features in Asgardeo and WSO2 Identity Server that I’m sure you’ll find intriguing! Don’t stop here, explore the plethora of features provided by them today.</p><p>Happy exploring!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a2542ec95c0e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integration of Huawei Map Kit in Kritify Application]]></title>
            <link>https://yoshani-malinka.medium.com/integration-of-huawei-map-kit-in-kritify-application-4edcddde0e55?source=rss-857dd675292d------2</link>
            <guid isPermaLink="false">https://medium.com/p/4edcddde0e55</guid>
            <category><![CDATA[hms-map-kit]]></category>
            <category><![CDATA[huawei]]></category>
            <category><![CDATA[huawei-developers]]></category>
            <category><![CDATA[hms-core]]></category>
            <dc:creator><![CDATA[Yoshani Ranaweera]]></dc:creator>
            <pubDate>Tue, 22 Jun 2021 07:26:13 GMT</pubDate>
            <atom:updated>2021-06-22T18:16:30.224Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*yQRde0zOaRBkT3q86K-I-g.jpeg" /></figure><p><strong>Introduction</strong></p><p>Huawei offers many handy services for developers in the form of kits. These kits can be easily integrated into applications using only a few lines of code, thus opening a plethora of opportunities for the development of the app.</p><p>This article is part 2 of the series on how Huawei Kits were integrated into our application, Kritify. To recap, Kritify is a one-stop social media platform that hosts all reviews of customers about business entities in one place. Whether it’s a hotel, restaurant, or clothing store, users can post reviews including photos they took on-premises, thus helping others find places that suit them, promoting the place. For doing so users earn points, which can potentially be used to get rewards from the site owners.</p><p>Kritify comprises two powerful kits offered by Huawei, the Account Kit and the Map Kit. In <a href="https://sachini-dissanayaka.medium.com/integration-of-huawei-account-kit-in-kritify-application-313b02c3afcc">part 1</a> of this series, it was explained how Account Kit was integrated in the Kritify application. In part 2, I will explain how Map Kit was integrated into the app.</p><p><strong>Use case and Demo</strong></p><p>In Kritify, Huawei Map Kit was used to accomplish two use cases.</p><p>1. Letting site owners specify their business location on a world map</p><p>2. Letting users view the locations on a map to easily find them when visiting the site</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZhrbSCabQKjqvFQtmJQC3A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n1OGXDmgBUSY5Tuw_g5i_g.jpeg" /></figure><p>Now let’s get our hands into coding and witness how Huawei Map Kit can enhance the usability of any app.</p><p><strong>Prerequisites</strong></p><p>Check these prerequisites before you begin.</p><ol><li>A Huawei Developer Account</li><li>A mobile phone running Android 4.4 or later</li><li>Android Studio 3.3 or later</li><li>JDK (JDK 1.8 is recommended)</li></ol><p><strong>Integration</strong></p><p>For integrating any Huawei Kit into our app, we first need to complete the following initial steps.</p><ol><li>Create an app in AppGallery Connect.</li><li>Add the app package name.</li><li>Create an Android Studio project.</li><li>Generate a signing certificate.</li><li>Generate a signing certificate fingerprint.</li><li>Configure the signing certificate fingerprint.</li><li>Add the AppGallery Connect plug-in and the Maven repository in the project-level build.gradle file.</li><li>Configure the signing certificate in Android Studio.</li></ol><p>For detailed information on these steps, please refer <a href="https://sachini-dissanayaka.medium.com/integration-of-huawei-account-kit-in-kritify-application-313b02c3afcc">part 1 of this series</a>, or visit <a href="https://developer.huawei.com/consumer/en/codelab/HMSPreparation/index.html#0">this codelab</a>.</p><p>After successfully completing the initial steps, you are finally ready to dive into using Huawei Map Kit! So the very first requirement is to actually enable Map Kit on the app you created on AppGallery Connect.</p><ol><li>Visit <a href="https://developer.huawei.com/consumer/en/service/josp/agc/index.html#/">AppGallery Connect</a> where you will see several icons. Click on My projects which is the second option.</li><li>Here you will see the project you created initially. Click on it and you will be redirected to the project settings page.</li><li>Click on ‘Manage APIs’ and you will see several Huawei Kits listed where you can either enable or disable them in your project.</li><li>Scroll down until you find Map Kit, and enable it.</li></ol><p>So now that we have enabled the Map Kit, it’s time for you to add the configuration file to your Android Project.</p><ol><li>Navigate back to ‘General information’ tab.</li><li>Scroll down until you find ‘App information’ section.</li><li>You will see the configuration file named agconnect-services.json. Download and add this file to the app’s root directory of your Android project.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/513/1*rJinIM2ASHA9BP7b3sfexA.png" /></figure><p>4. Next we have to add the Build Dependencies. In the app-level build.gradle file of your project, add the following dependency.</p><pre>dependencies {<br>implementation ‘com.huawei.hms:maps:5.3.0.300<br>}</pre><p>5. Add <strong>apply plugin: ‘com.huawei.agconnect</strong>’ to the header of the same file.</p><p>We have set up the environment for using Map Kit. It’s time for using the Map in our code. We need to set some permissions in AndroidManisfest.xml file. Inside the application tag, add these permissions.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/008710773cf95ac02a09558b7d4c1b72/href">https://medium.com/media/008710773cf95ac02a09558b7d4c1b72/href</a></iframe><p>The Maps is available to be used in many map containers such as <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/mapview-0000001050150338-V5">MapView</a>, <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/mapfragment-0000001050150294-V5">MapFragment</a>, <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/supportmapfragment-0000001050153243-V5">SupportMapFragment</a>, <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/texturemapview-0000001051004791-V5">TextureMapView</a>, <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/texturemapfragment-0000001050724736-V5">TextureMapFragment</a>, and <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/texturesupportmapfragment-0000001051084710-V5">TextureSupportMapFragment</a>. In Kritify we used MapFragment to achieve our use cases.</p><p>Inside your layout file, add the following code block</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/41b2d34fa00470e478f2716a2988dddf/href">https://medium.com/media/41b2d34fa00470e478f2716a2988dddf/href</a></iframe><p>To use the map, we need to implement <a href="https://developer.huawei.com/consumer/en/doc/development/HMSCore-References-V5/onmapreadycallback-0000001050150378-V5">OnMapReadyCallback</a> API in the corresponding Activity file.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8b6c9bd656d9429eb9242c32baca8a6c/href">https://medium.com/media/8b6c9bd656d9429eb9242c32baca8a6c/href</a></iframe><p>Inside the onCreate() method of the Activity file, we shall load the MapFragment and call getMapAsync() to register the callback.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ba8a221444a77ec4f0bb863d7e0a6e4f/href">https://medium.com/media/ba8a221444a77ec4f0bb863d7e0a6e4f/href</a></iframe><p>Next we need to Override the onMapReady() callback method to obtain the map.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/34375af3be2e0be9f213c57f0131f7b2/href">https://medium.com/media/34375af3be2e0be9f213c57f0131f7b2/href</a></iframe><p>It’s showtime! Run the project to see a fully functional world map on your app.</p><p>For further reference, I will post the full code of my Activity file used for displaying the site location to users of Kritify.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/34f7e85d7ccb2e1ff9ffcc5c7e3f89de/href">https://medium.com/media/34f7e85d7ccb2e1ff9ffcc5c7e3f89de/href</a></iframe><p>Note: If the API level is 23 or higher (Android 6.0 or later), you need to dynamically apply for accessing location permissions during runtime. This should be done prior to navigating to the Activity in which you intend to use the map.</p><p>To dynamically apply for permissions, the following methods can be implemented in the previous activity that lets you navigate into the MapActivity.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c59ca5866a9c2bfd083eff2b58e9f323/href">https://medium.com/media/c59ca5866a9c2bfd083eff2b58e9f323/href</a></iframe><p>To check if location permissions have been granted at any place of the code you want, just use:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/219992273fc9febfb88eb245665e6c46/href">https://medium.com/media/219992273fc9febfb88eb245665e6c46/href</a></iframe><p><strong>Result</strong></p><p>Download and enjoy the final Kritify application on <a href="https://appgallery.cloud.huawei.com/ag/n/app/C104377359?locale=en_GB&amp;source=appshare&amp;subsource=C104377359">Huawei AppGallery</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*hhGupa_7xci-N9bqQvmVXQ.gif" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4edcddde0e55" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>