<?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 Sandushidileka on Medium]]></title>
        <description><![CDATA[Stories by Sandushidileka on Medium]]></description>
        <link>https://medium.com/@sandushidileka2?source=rss-394f4ab0ee69------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*KshaDdWzmPB_dY_km-66mQ.jpeg</url>
            <title>Stories by Sandushidileka on Medium</title>
            <link>https://medium.com/@sandushidileka2?source=rss-394f4ab0ee69------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 07:29:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sandushidileka2/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[Your REST APIs might be Wrong — Here’s why]]></title>
            <link>https://medium.com/@sandushidileka2/your-rest-apis-might-be-wrong-heres-why-683f3ab371c8?source=rss-394f4ab0ee69------2</link>
            <guid isPermaLink="false">https://medium.com/p/683f3ab371c8</guid>
            <category><![CDATA[rest-api]]></category>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[rest-api-design]]></category>
            <dc:creator><![CDATA[Sandushidileka]]></dc:creator>
            <pubDate>Thu, 26 Mar 2026 07:43:17 GMT</pubDate>
            <atom:updated>2026-03-26T07:44:28.315Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MEL-vFzK19EWWwbrlHXPWw.png" /></figure><p>When I first started building backend applications with Spring Boot, designing REST APIs felt simple.</p><p>Create a controller, define a few endpoints, connect them to the database, and return JSON — done ✅</p><p>And honestly, in the beginning, that <em>worked</em>.</p><p>But things started to change when I moved from small features to real-world systems — systems that handled multiple clients, production traffic, and evolving business requirements.</p><p>Suddenly:</p><ul><li>APIs became harder to maintain</li><li>Small changes started breaking existing functionality</li><li>Frontend teams struggled to integrate cleanly</li><li>Performance issues began to appear</li><li>Debugging production issues became more painful than expected</li></ul><p>That’s when I realized something important:</p><p>👉 <strong>Designing a REST API is not just about making it work — it’s about making it scalable, predictable, and easy to use.</strong></p><p>A well-designed API acts as a <strong>contract</strong> between your backend and its consumers — whether it’s a frontend application, a mobile app, or another microservice. If that contract is unclear or inconsistent, everything built on top of it starts to suffer 😩</p><p>At the same time, I noticed something interesting — especially during interviews. Even though we follow best practices in our day-to-day work, many developers (including myself at sometimes 😉) tend to <strong>get stuck when explaining these concepts clearly</strong>.</p><p>Not because we don’t know them, but because we don’t always <strong>think about them consciously</strong> while building systems.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IOU8uWZGywxLEG-F8t8nOw.png" /></figure><p>👉 This blog is for anyone who has had that same experience — a practical reminder of the things we already know, but don’t always articulate well.</p><p>In this blog, I want to share some of the <strong>most common mistakes developers make when designing REST APIs</strong> — mistakes I’ve seen, and honestly, mistakes I’ve made myself at the beginning.</p><p>Let’s dig into the common mistakes.</p><h3>❌ 1. Poor Resource Naming</h3><p>One of the most common mistakes is using <strong>unclear or inconsistent naming</strong>.</p><p>🚫 Bad:</p><pre>/getUsers<br>/createNewUser<br>/deleteUserById</pre><p>✅ Good</p><pre>/users<br>/users/{id}</pre><p>👉 REST APIs should be <strong>resource-based</strong>, not action-based.</p><p>Use:</p><ul><li>Nouns (users, orders, products)</li><li>HTTP methods to define actions: <br>- GET → fetch<br>- POST → create<br>- PUT/PATCH → update<br>- DELETE → remove</li></ul><h3>❌ 2. Ignoring HTTP Methods Semantics</h3><p>Sometimes developers misuse HTTP methods.</p><p>🚫 Example:</p><p>Using GET to delete data or trigger changes.</p><p>👉 This breaks a fundamental REST principle: GET requests must be safe and idempotent (no side effects).</p><p>✅ Correct usage:</p><ul><li>GET → read-only (no side effects)</li><li>POST → create</li><li>PUT → full update</li><li>PATCH → partial update</li><li>DELETE → remove</li></ul><p>👉 These are not just conventions — they are <strong>contracts</strong> that clients rely on.</p><p>For more details -&gt; <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods">https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Methods</a></p><h3>❌ 3. Not Using Proper HTTP Status Codes</h3><p>Returning 200 OK for everything is a big mistake.</p><p>🚫 Common mistake</p><p>Returning 200 OK even when:</p><ul><li>validation fails</li><li>authentication is missing</li><li>resource is not found</li><li>server errors occur</li></ul><pre>{<br>  &quot;status&quot;: &quot;error&quot;,<br>  &quot;message&quot;: &quot;User not found&quot;<br>}</pre><p><strong>…but still returning </strong><strong>200 OK</strong></p><p>⚠️<strong> Why this becomes a problem</strong></p><p>When you ignore proper status codes:</p><ul><li>Frontend logic becomes messy (extra checks everywhere)</li><li>Error handling becomes inconsistent across applications</li><li>Monitoring and logging tools cannot correctly detect failures</li><li>API consumers lose trust in your API behavior</li></ul><p>👉 In production systems, this leads to <strong>hard-to-debug issues and poor developer experience</strong>.</p><p>✅ Use meaningful status codes:</p><ul><li>200 OK → success</li><li>201 Created → resource created</li><li>400 Bad Request → client error</li><li>401 Unauthorized → auth required</li><li>403 Forbidden → no permission</li><li>404 Not Found</li><li>500 Internal Server Error</li></ul><p>👉 Think of status codes as the <strong>first signal</strong> your API sends — before the response body.</p><p>For more details -&gt; <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status">https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status</a></p><h3>❌ 4. Poor Error Handling</h3><p>Another common mistake in REST API design is <strong>returning vague, unstructured, or inconsistent error responses</strong>.</p><p>You’ve probably seen this before:</p><pre>Something went wrong</pre><p>At first glance, it seems fine — the API is indicating failure.<br>But in reality, this kind of response is <strong>almost useless</strong> for both developers and users.</p><p>✅ What a good error response looks like,</p><ul><li>A well-designed API should return <strong>structured, consistent, and informative error responses</strong>.</li></ul><p>For example:</p><pre>{<br>  &quot;timestamp&quot;: &quot;2026-03-26T10:00:00Z&quot;,<br>  &quot;status&quot;: 400,<br>  &quot;error&quot;: &quot;Bad Request&quot;,<br>  &quot;message&quot;: &quot;Email is required&quot;,<br>  &quot;path&quot;: &quot;/users&quot;<br>}</pre><p>👉 In production systems, structured error responses:</p><ul><li>improve debugging</li><li>enhance user experience</li><li>reduce support effort</li></ul><h3>❌ 5. Over-fetching and Under-fetching Data</h3><p>Designing what data your API returns is just as important as designing the endpoint itself.<br>A common mistake developers make is <strong>returning either too much data or too little</strong> — both of which negatively impact performance and user experience.</p><p>🚫 <strong>Over-fetching</strong></p><p>This happens when your API returns <strong>more data than the client actually needs</strong>.</p><p>For example:</p><ul><li>Returning the full user object (including metadata, preferences, audit fields)</li><li>When the UI only needs a name and email</li></ul><p>👉 This leads to:</p><ul><li>unnecessary network usage</li><li>slower response times</li><li>increased load on backend systems</li></ul><p>🚫 <strong>Under-fetching</strong></p><p>This is the opposite problem — when your API doesn’t return enough data, forcing the client to make <strong>multiple requests</strong> to gather what it needs.</p><p>For example:</p><ul><li>One API to get user details</li><li>Another API to get user roles</li><li>Another API to get user preferences</li></ul><p>👉 This results in:</p><ul><li>multiple round trips</li><li>higher latency</li><li>more complex frontend logic</li></ul><p>⚠️ Both patterns directly impact <strong>performance, scalability, and usability</strong>.</p><p>✅ Better approach</p><p>A well-designed API should return <strong>just the right amount of data</strong> — no more, no less.</p><p>Here are some practical techniques:</p><ul><li><strong>Pagination</strong><br> Avoid loading large datasets at once</li></ul><pre>/users?page=1&amp;size=10</pre><ul><li><strong>Filtering</strong><br> Allow clients to request only relevant data</li></ul><pre>/users?role=admin</pre><ul><li><strong>DTOs (Data Transfer Objects)</strong><br> Return only the fields needed by the client, instead of exposing entire database models</li></ul><p>👉 Don’t just think about <em>what your API can return</em> — think about <em>what the client actually needs</em>.</p><h3>❌ 6. Ignoring API Versioning</h3><p>APIs are not static — they evolve over time.</p><p>As new features are added, business requirements change, and improvements are made, your API will inevitably need updates. The mistake many developers make is <strong>not planning for this evolution early on</strong>.</p><p>🚫 The problem with no versioning</p><p>A typical unversioned API might look like:</p><pre>/users</pre><p>At first, this seems clean and simple. But what happens when you need to:</p><ul><li>change the response structure?</li><li>rename fields?</li><li>add new mandatory parameters?</li></ul><p>👉 Any of these changes can <strong>break existing clients</strong> that depend on the current behavior.</p><p>✅ Use versioning from the beginning</p><p>A simple and effective approach is to version your API in the URL:</p><pre>/api/v1/users<br>/api/v2/users</pre><p>👉 Good versioning strategy is a balance between <strong>stability and progress</strong>.</p><h3>❌ 7. Not Thinking About Security Early</h3><p>Security is one of the most critical aspects of API design — yet it’s often treated as something to “add later.”</p><p>In early development stages, it’s common to focus on functionality:<br> 👉 “Let’s get it working first… we’ll secure it later.”</p><p>But in reality, this approach is <strong>highly risky</strong>, especially for APIs that handle user data, authentication, or sensitive operations.</p><p>🚫 Common mistakes</p><p>When security is not considered from the beginning, APIs often end up with:</p><ul><li><strong>No proper authentication</strong><br> Endpoints are exposed without verifying who is making the request</li><li><strong>Exposing sensitive data</strong><br> Returning internal fields like passwords (even hashed), tokens, or internal identifiers</li><li><strong>Weak or incorrect token validation</strong><br> Accepting expired, malformed, or improperly signed JWTs</li></ul><p>👉 These issues can lead to <strong>serious vulnerabilities and data breaches</strong>.</p><p>✅ Best practices to follow</p><p>Security should be built into your API from day one.</p><ul><li><strong>Use proper authentication mechanisms</strong><br> Implement standards like OAuth 2.0 and JWT for secure identity handling</li><li><strong>Validate all inputs</strong><br> Never trust client input — validate and sanitize everything</li><li><strong>Avoid exposing sensitive data</strong><br> Only return what is necessary; hide internal or confidential fields</li><li><strong>Implement proper authorization (RBAC/ABAC)</strong><br> Ensure users can only access what they are allowed to</li></ul><h3>❌ 8. Tight Coupling Between Layers</h3><p>Directly exposing database models in API responses is a common issue.</p><p>🚫 Problem:</p><ul><li>Changes in DB → break API</li><li>Leaks internal structure</li></ul><p>✅ Solution:</p><ul><li>Use DTOs (Data Transfer Objects)</li><li>Separate:<br>- Controller<br>- Service<br>- Repository layers</li></ul><p>👉 This improves:</p><ul><li>maintainability</li><li>flexibility</li><li>testability</li></ul><h3>❌ 9. Lack of Documentation</h3><p>Even a well-designed API is useless if nobody understands how to use it.</p><p>✅ Always provide:</p><ul><li>Endpoint descriptions</li><li>Request/response examples</li><li>Authentication details</li></ul><p>👉 Tools like Swagger/OpenAPI make this much easier.</p><h3>🚀 Final Thoughts</h3><p>Designing REST APIs is not just about making things work — it’s about making them:</p><ul><li>intuitive</li><li>reliable</li><li>scalable</li><li>secure</li></ul><p>From my experience, the real shift happens when you stop thinking like someone building a feature and start thinking like someone designing a <strong>platform others will depend on</strong>.</p><p>👉 Every endpoint you design becomes a long-term contract.<br> 👉 Every decision you make today affects how easily your system can evolve tomorrow.</p><h3>💡 <strong>Lessons Learned</strong></h3><p>Good APIs don’t happen by accident — they are <strong>intentionally designed</strong>.</p><p>If there’s one thing I’ve learned over the years, it’s this:</p><p>👉 <em>The best APIs are the ones developers don’t struggle to use.</em></p><p>So the next time you design an API, ask yourself:</p><ul><li>Is this predictable?</li><li>Is this consistent?</li><li>Is this easy to consume?</li></ul><p>Because fixing these things early is simple — but fixing them in production is often painful.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=683f3ab371c8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Idea to Blueprint: How to Design a Feature Before Writing Any Code]]></title>
            <link>https://medium.com/@sandushidileka2/from-idea-to-blueprint-how-to-design-a-feature-before-writing-any-code-4988bfd89915?source=rss-394f4ab0ee69------2</link>
            <guid isPermaLink="false">https://medium.com/p/4988bfd89915</guid>
            <category><![CDATA[mvp]]></category>
            <category><![CDATA[best-before-coding]]></category>
            <category><![CDATA[feature-development]]></category>
            <category><![CDATA[product-design]]></category>
            <dc:creator><![CDATA[Sandushidileka]]></dc:creator>
            <pubDate>Fri, 15 Aug 2025 07:37:11 GMT</pubDate>
            <atom:updated>2025-08-15T07:48:16.798Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FkUSO8XJ8ao2SZfMAGndoQ.png" /></figure><p>Building features without a plan is like starting a road trip without a map — you’ll still get somewhere, but it might not be where you intended.</p><p>When you get a great idea for a feature, the temptation is to jump straight into coding. But in real product teams, that’s a fast way to build something confusing, incomplete, or misaligned with the business goal.</p><p>In a professional setting, especially when working in teams, feature planning ensures everyone shares the same mental model and understands the “why” before the “how.”</p><p>Good features start with good design — not just UI design, but <strong>feature design</strong>: <em>the process of translating a problem into a plan that developers, designers, and stakeholders understand.</em></p><p>So, before we touch the keyboard, let’s walk through the key steps that set a feature up for success.</p><p>Let’s dive into this with a real world example scenario.</p><h3>Example: Customer Success Follow-Up Tracker</h3><p>Think your small product team supports the Customer Success department. After every customer call, they need to log follow-up tasks — sending product guides, scheduling training, flagging bugs — and track them until completion.</p><p>Currently, the process is scattered across spreadsheets and Slack DMs. Things slip. Customers notice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*1xxZXINwhhOXfflbF1AKBw.png" /></figure><p>How to solve this problem? Let’s look at this step by step.</p><h3>Step 1: Understand the Problem &amp; Goal</h3><p>Before anything else, clarify:</p><ol><li>What problem are we solving?</li></ol><ul><li>Missed follow-ups due to scattered tracking</li></ul><p>2. Who is affected?</p><ul><li>Customer Success Agents &amp; Team Leads</li></ul><p>3. What do we need to do?</p><ul><li>Implement a tracking system for all the tasks</li></ul><p>4. What’s the business goal?</p><ul><li>Increase task completion rate and customer satisfaction</li></ul><p>5. When do we need it?</p><ul><li>Within four sprints</li></ul><p>📌 Tip: Write this down in plain language so everyone can refer back to it.</p><h3>Step 2: Identify Users &amp; Personas</h3><p>Think about who will use the feature and what they need.</p><p><strong>Agent</strong></p><ul><li>Creates and completes tasks</li><li>Filters by customer or due date</li></ul><p><strong>Lead</strong></p><ul><li>Views team workload</li><li>Sees overdue tasks</li></ul><p>🧭 Knowing these personas will guide UI design, permissions, and reporting needs.</p><h3>Step 3: Define User Stories</h3><p>User stories help you think in terms of outcomes, not just features.</p><p>Let’s walk through one of the Agent’s usecase and how to write a user story for that.</p><p><strong>Persona: Agent — Alice</strong></p><ul><li>Role: Customer Success Agent</li><li>Goal: Log follow-ups right after calls and keep her day organized</li></ul><p><strong>Use Case 1 — Create a task</strong></p><p>Scenario: Alice just finished a call with Acme Co. She needs to send the onboarding guide and book a training session.</p><ol><li>Open Quick Add.</li><li>Alice clicks “+ New Task” on the dashboard.</li><li>Enter the essentials like Title, Customer, Priority, Due date, Description.</li><li>Alice clicks on the Save button.</li><li>The task appears at the top of the list with status Open.</li></ol><p><strong>Acceptance Criteria</strong></p><ul><li>Title required; due date cannot be in the past.</li><li>On save, task appears in the list without page refresh.</li></ul><h3>Step 4: Map the Task Flow</h3><p>A task flow is a visual map of the steps a user takes from start to finish to achieve a goal.<br>In feature design, this is critical because it helps you:</p><ul><li>Understand the user journey step by step.</li><li>Spot decision points and error handling early.</li><li>Identify dependencies between steps (e.g., validation before saving).</li><li>Communicate clearly with designers and developers about how things should work.</li></ul><p>The flowchart below represents how Alice goes from finishing a customer call to having a completed follow-up task in the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xcL5XegaCZsKS63SB0o8ug.png" /></figure><h3>Step 5: Design the Data Model</h3><p>Think about what you need to store, but don’t overcomplicate the MVP (Minimal Viable Product).</p><p><strong>Entities:</strong></p><ul><li>Users</li><li>Customers</li><li>Tasks</li><li>Comments</li></ul><p>At this stage, we define each entity’s attributes based on the requirements and map out the relationships between them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VV-e7hvRz0k-wFQbfaRTXw.png" /></figure><h3>Step 6: Plan the API Endpoints</h3><p>Planning your API endpoints is like creating a contract between the frontend and backend before either side starts building. Even if you’re the only developer, documenting APIs now avoids misunderstandings later.</p><ol><li>Start with the User Stories<br>Go back to your user stories/personas. For each action a user can take, think:</li></ol><ul><li>What data does the frontend need to send?</li><li>What data does the backend need to return?</li></ul><p>2. Choose a Naming Convention</p><ul><li>Nouns for resources (/api/tasks)</li><li>Use plural names for collections</li><li>HTTP verbs define the action (GET, POST, PATCH, DELETE)</li></ul><p>3. For each resource, list all the CRUD operations you need for MVP only. Avoid adding “future features” that aren’t in scope yet.</p><p><strong>Example :</strong></p><p>Tasks:</p><blockquote>GET /api/tasks → list task swith filters</blockquote><blockquote>POST /api/tasks → create tasks</blockquote><blockquote>PATCH /api/tasks/:id → update tasks</blockquote><blockquote>POST /api/tasks/:id/complete → mark done</blockquote><blockquote>GET /api/tasks/:id/comments → list comments</blockquote><blockquote>POST /api/tasks/:id/comments → add comment</blockquote><h3>Step 7: Sketch the UI (Wireframes)</h3><p>Before you start writing React components, you need a clear picture of how the user will interact with your feature.</p><p><strong>Wireframes</strong> are quick, low-fidelity sketches of the interface. They’re not about colors, fonts, or branding — they’re about layout, flow, and functionality.</p><p>📌 Tips for MVP Wireframes</p><ul><li>Keep them simple — Boxes, labels, and basic icons are enough.</li><li>Include key states — e.g., empty list, list with items, form filled, form errors.</li><li>Think about mobile — Even if you start with desktop, know how it will adapt.</li><li>Use placeholders for real data.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P4ULc4mufqQuMsk1VN2D5Q.png" /></figure><h3>Step 8: Validate Before You Build</h3><p>Validation is the last checkpoint before you start writing code.</p><p>It’s your opportunity to confirm that your planned feature is useful, usable, and buildable — and that you’re not wasting time building the wrong thing.</p><p><strong>Who to Validate With ?</strong></p><ol><li>Stakeholders — e.g., Customer Success lead</li></ol><ul><li>They ensure the feature solves the actual business problem.</li><li>They check that priorities align with company goals.</li></ul><p>2. Future Users — e.g., Customer Success agents</p><ul><li>They can tell you if the flow fits their daily workflow.</li><li>They might suggest shortcuts or highlight missing steps.</li></ul><p>3. A Developer (if you’re not the one building it)</p><ul><li>They confirm technical feasibility within the given timeline.</li><li>They might point out performance, security, or complexity issues.</li></ul><p>Make sure the followings during the validation stage.</p><ul><li><strong>Does this cover your needs?</strong><br> → Make sure the solution actually solves the core problem you set out to address.</li><li><strong>Is anything missing?</strong><br> → Identify gaps early so you can add them now, before code locks you in.</li><li><strong>Is anything unnecessary for MVP?</strong><br> → Cut features that aren’t essential for launch. This keeps scope realistic and delivery on time.</li></ul><h3>Step 9: Document It</h3><p>After you’ve clarified the problem, mapped flows, designed data models, and planned your APIs, the next step is to package all of it into one single document — your Feature Design Document (FDD).</p><p>This is not busywork. It’s the source of truth that ensures everyone — developers, designers, testers, and stakeholders — is working from the same playbook.</p><p>What to Include in the Feature Design Document ?</p><ul><li>Problem &amp; Goal</li><li>Personas &amp; User Stories</li><li>Flow Diagram</li><li>Data Model</li><li>API Contracts</li><li>Wireframes</li><li>Out-of-Scope Items</li></ul><p>💡 Pro Tip: Keep your feature design document in a shared, version-controlled space (like Notion, Confluence, or GitHub wiki) so updates are tracked and accessible.</p><p>Now you are done with the designing phase 👏</p><p>Follow these steps, and you’ll replace guesswork with clarity, avoid costly rework, and give your development phase a running start.</p><p>Remember — <strong>great code starts with great design</strong>.</p><h3>Final Thoughts ✨</h3><p>Designing a feature before you write a single line of code isn’t about slowing down — it’s about building the right thing, the right way, the first time.</p><p>When you take the time to define the problem, understand your users, map the flow, design the data model, plan your APIs, and sketch the UI, you’re setting yourself up for a smoother development process, fewer surprises, and a feature that actually delivers value.</p><p>Think of it like building a house 🏠 — you wouldn’t start laying bricks without a blueprint. Your feature design is that blueprint.</p><p>So the next time inspiration strikes, resist the urge to dive straight into your IDE.<br><strong>Pause, plan, and then build with confidence.<br></strong>Your future self (and your users) will thank you. 🙌</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4988bfd89915" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Supercharge Your Google Sheets with App Script Automations]]></title>
            <link>https://medium.com/@sandushidileka2/supercharge-your-google-sheets-with-app-script-automations-456d62db3c1c?source=rss-394f4ab0ee69------2</link>
            <guid isPermaLink="false">https://medium.com/p/456d62db3c1c</guid>
            <dc:creator><![CDATA[Sandushidileka]]></dc:creator>
            <pubDate>Sun, 30 Mar 2025 15:20:27 GMT</pubDate>
            <atom:updated>2025-03-30T15:20:27.266Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*ettOwPHSK5GmCX7PqaoYwg.png" /></figure><p>Google Sheets is more than just rows and columns —<strong> it’s a powerful tool that can automate workflows and streamline communication</strong>. Whether you’re managing projects, tracking data, or facilitating communication, Google Sheets combined with Apps Script can transform tedious tasks into smooth, automated processes. With just a few lines of code, you can create interactive features, streamline notifications, and boost team efficiency — all within the familiar spreadsheet environment.</p><p>In this tutorial, we’re going to explore how to enhance Google Sheets with automation that improves team collaboration and efficiency. We’ll be focusing on a practical use case — <strong>automating task assignments and notifications</strong>.</p><h3>🚀 Task Assignment Notifications</h3><p>Imagine you manage a team that tracks tasks in Google Sheets. Instead of manually messaging team members about new assignments, wouldn’t it be great if Google Sheets could send a <strong>real-time notification</strong> to your Google Chat space?</p><p>We’ll build an Apps Script solution that does exactly that. Users will enter a <strong>task name and assignee</strong> in a popup form, and a <strong>chat notification</strong> will be sent automatically.</p><h3>🛠 Prerequisites</h3><p>Before we begin, let’s set up our Google Sheet properly. Open a new or existing sheet and add the following column headers in the first row:</p><ul><li><strong>Timestamp</strong></li><li><strong>Task Name</strong></li><li><strong>Assignee</strong></li></ul><p>This will help us keep a structured record of all assigned tasks.</p><p>Now, make sure you have: Before we begin, make sure you have:</p><p>✅ A <strong>Google account</strong> with access to Google Sheets.<br>✅ A <strong>Google Chat space</strong> where notifications will be sent.<br>✅ A <strong>Webhook URL</strong> (we’ll set this up next!).</p><h4>🔗 How to Create a Google Chat Webhook URL</h4><ol><li>Open <strong>Google Chat</strong> and go to the space where you want to receive notifications.</li><li>Click on the space name and select <strong>Apps &amp; Integrations</strong>.</li><li>Click <strong>Add Webhooks</strong>, enter a name (e.g., “Task Manager”), and click <strong>Save</strong>.</li><li>Copy the <strong>Webhook URL</strong> — we’ll need this in our script.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NEGf52OwH7OB9RUS3dysog.png" /></figure><h3>✨ Step 1: Open Google Apps Script Editor</h3><ol><li>Open a <strong>Google Sheet</strong>.</li><li>Click on <strong>Extensions</strong> &gt; <strong>Apps Script</strong>.</li></ol><p>You should have the editor access of the google sheet to access this Extensions of the google sheet.</p><h3>📌 Step 2: Create a Custom Menu</h3><p>You can use the code.gs file to enter you code which needs to be run.</p><p>We’ll add a custom menu called <strong>Task Manager</strong>, which will trigger a popup form.</p><pre>function onOpen() {<br> var ui = SpreadsheetApp.getUi();<br> ui.createMenu(&#39;Task Manager&#39;)<br> .addItem(&#39;Assign Task&#39;, &#39;showTaskForm&#39;)<br> .addToUi();<br>}</pre><p>Reload the sheet, and you’ll see the <strong>Task Manager</strong> menu at the top! 🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPY-XRqDz39FePzE83ctJw.png" /></figure><h3>📝 Step 3: Create a Task Assignment Form</h3><p>We’ll create a simple HTML form where users can enter a <strong>task name</strong> and <strong>assignee</strong>.</p><ol><li>Click <strong>File</strong> &gt; <strong>New</strong> &gt; <strong>HTML</strong> and name it taskForm.html.</li><li>Paste the following code:</li></ol><pre>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>  &lt;head&gt;<br>    &lt;script&gt;<br>      function submitTask() {<br>        var task = document.getElementById(&#39;task&#39;).value;<br>        var assignee = document.getElementById(&#39;assignee&#39;).value;<br>        google.script.run.sendToChat(task, assignee);<br>      }<br>    &lt;/script&gt;<br>  &lt;/head&gt;<br>  &lt;body&gt;<br>    &lt;h3&gt;Assign a Task&lt;/h3&gt;<br>    &lt;label for=&quot;task&quot;&gt;Task Name:&lt;/label&gt;<br>    &lt;input type=&quot;text&quot; id=&quot;task&quot; /&gt;<br>    &lt;br&gt;&lt;br&gt;<br>    &lt;label for=&quot;assignee&quot;&gt;Assignee:&lt;/label&gt;<br>    &lt;input type=&quot;text&quot; id=&quot;assignee&quot; /&gt;<br>    &lt;br&gt;&lt;br&gt;<br>    &lt;input type=&quot;button&quot; value=&quot;Assign&quot; onclick=&quot;submitTask()&quot;/&gt;<br>&lt;/html&gt;<br></pre><h3>🖥 Step 4: Show the Task Form in Google Sheets</h3><p>Now, we’ll modify our script to display the form when <strong>Assign Task</strong> is clicked.</p><pre>function showTaskForm() {<br>  var html = HtmlService.createHtmlOutputFromFile(&#39;taskForm&#39;)<br>    .setWidth(300)<br>    .setHeight(250);<br>  SpreadsheetApp.getUi().showModalDialog(html, &#39;Assign Task&#39;);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jRAdzgAutd8Sfd1SVuyKdQ.png" /></figure><h3>📢 Step 5: Save Task to Google Sheet &amp; Send Notifications to Google Chat</h3><p>Before sending a notification, we’ll also store the task details in the sheet for easy tracking. Each task entry will be recorded with a timestamp, task name, and assignee. This function will send the <strong>task details</strong> to the chat space using the webhook URL.</p><pre>function sendToChat(task, assignee) {<br>  var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();<br>  sheet.appendRow([new Date(), task, assignee]);<br>  var webhookUrl = &#39;YOUR_WEBHOOK_URL_HERE&#39;;<br>  var message = `📢 *New Task Assigned!* \n -*Task:* ${task} \n -*Assignee:* ${assignee}`;<br>  var payload = {<br>    &#39;text&#39;: message<br>  };<br>  var options = {<br>    &#39;method&#39;: &#39;post&#39;,<br>    &#39;contentType&#39;: &#39;application/json&#39;,<br>    &#39;payload&#39;: JSON.stringify(payload)<br>  };<br>  UrlFetchApp.fetch(webhookUrl, options);<br>}</pre><p>🛑 <strong>Don’t forget to replace</strong> &#39;YOUR_WEBHOOK_URL_HERE&#39; <strong>with the actual webhook URL you created earlier!</strong></p><h3>🎬 Step 6: Save &amp; Run the Script</h3><p>Now that everything is set up, let’s test it out!</p><ol><li>Click <strong>Save</strong> in the Apps Script editor.</li><li>Reload the <strong>Google Sheet</strong>.</li><li>Click <strong>Task Manager</strong> &gt; <strong>Assign Task</strong>.</li><li>Enter a <strong>task name</strong> and an <strong>assignee</strong> in the popup.</li><li>Click <strong>Assign</strong>.</li><li>Check your <strong>Google Chat space</strong> — a notification should appear instantly! 🚀</li><li>Open your <strong>Google Sheet</strong> and verify that the new task entry (Timestamp, Task Name, Assignee) has been added successfully.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*b2KP_JqwdBru2IILkGt9mA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c7xoDhJZnOZEp2bSpeBR2Q.png" /></figure><p>All done 🎉. You just built a <strong>Google Sheets automation</strong> that sends notifications to Google Chat.</p><p>This system is perfect for <strong>task management, reminders, or team updates</strong>. Want to take it further? You can:</p><ul><li>Add a <strong>due date</strong> field.</li><li>Customize the message format with rich text.</li></ul><p>Give it a try and let me know how it works for you! 🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=456d62db3c1c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide to Unit Testing with Mocking in Java]]></title>
            <link>https://medium.com/@sandushidileka2/a-beginners-guide-to-unit-testing-with-mocking-in-java-92c5704c1b09?source=rss-394f4ab0ee69------2</link>
            <guid isPermaLink="false">https://medium.com/p/92c5704c1b09</guid>
            <dc:creator><![CDATA[Sandushidileka]]></dc:creator>
            <pubDate>Mon, 24 Jun 2024 02:17:33 GMT</pubDate>
            <atom:updated>2024-06-24T02:17:55.968Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MP8dGCOzd39-P94AdWNQfA.png" /></figure><p>Hi everyone!</p><p>As software developers, it’s our responsibility to ensure the coding is correct and will perform as expected. For the sake of this, it’s good to test and catch the errors early to fix.</p><p><strong>How can we test our product?</strong></p><p>There are many different types of tests in software development as below.</p><ul><li>Acceptance testing</li><li>Integration testing</li><li>Unit testing</li><li>Functional testing</li><li>Performance testing</li><li>Regression testing</li><li>Stress testing</li></ul><p>From this blog, we are going to look into one of the more important software tests : Unit testing.</p><p>Let’s start to explore <strong>Unit testing</strong>.</p><h3>What is Unit testing? Why is it important?</h3><p>As the name suggests,<strong><em> Unit tests are written to test individual units of an application without external processes or systems</em></strong>.</p><p>In other words, the main purpose is to validate that each individual unit worked as required. It helps in identifying bugs early, improving code quality, and facilitating code changes.</p><p>In the <strong>Test-Driven Development (TDD)</strong>, the unit testing plays a crucial role and the developers write unit tests before writing the actual code, ensuring that each component is thoroughly tested from the outset. By writing tests first, developers can identify and fix issues early, leading to more robust and maintainable code.</p><p>Unit testing is important for several reasons:</p><ol><li><strong>Early bug detection</strong> —As I mentioned above, developers can identify and fix the bugs in the development phases, preventing them from propagating to higher stages where they are very expensive to fix.</li><li><strong>Code quality</strong> — Unit tests enforce a higher standard of code quality. Developers are encouraged to write more modular, reusable, and maintainable code when they know it will be subjected to rigorous testing.</li><li><strong>Refactoring Safety — </strong>With a comprehensive suite of unit tests, developers can refactor code with confidence. If changes inadvertently introduce bugs, the unit tests will quickly highlight these issues, ensuring that the software remains functional.</li><li><strong>Cost Efficiency</strong>: Identifying and fixing bugs during the unit testing phase is significantly cheaper than addressing issues found in later stages of development, such as integration or system testing, or after the product has been deployed.</li></ol><p><strong>Mocking</strong> is needed in unit testing because it allows us to test a specific piece of code without relying on its real dependencies, like databases or external services. By creating fake versions of these dependencies, we can control their behavior, ensuring our tests are fast, reliable, and focused only on the code being tested.</p><p>Let’s start to write unit testing.</p><p>Before begin, ensure that you have Java, Maven, and an IDE like IntelliJ IDEA or Eclipse installed.</p><p>To use Mockito and JUnit in your project, add the following dependency to your pom.xml</p><blockquote>&lt;dependencies&gt;<br> &lt;! — Other dependencies →<br> &lt;dependency&gt;<br> &lt;groupId&gt;org.mockito&lt;/groupId&gt;<br> &lt;artifactId&gt;mockito-core&lt;/artifactId&gt;<br> &lt;version&gt;4.0.0&lt;/version&gt;<br> &lt;scope&gt;test&lt;/scope&gt;<br> &lt;/dependency&gt;<br> &lt;dependency&gt;<br> &lt;groupId&gt;org.junit.jupiter&lt;/groupId&gt;<br> &lt;artifactId&gt;junit-jupiter-engine&lt;/artifactId&gt;<br> &lt;version&gt;5.8.1&lt;/version&gt;<br> &lt;scope&gt;test&lt;/scope&gt;<br> &lt;/dependency&gt;<br>&lt;/dependencies&gt;</blockquote><p>Consider a class UserStoreManager that interacts with RealmService to fetch user information. We will demonstrate how to write unit tests for this class using mocks to simulate the behavior of its dependencies.</p><p>UserStoreManager.java</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0efaf32a60646851de812e61bf231f4b/href">https://medium.com/media/0efaf32a60646851de812e61bf231f4b/href</a></iframe><p>In this class, UserStoreManager depends on RealmService to get user information. To test the UserStoreManager class, we will mock the RealmService and its methods.</p><p>UserStoreManagerTest.java</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8910c77407ab3b72e7917434388c262/href">https://medium.com/media/b8910c77407ab3b72e7917434388c262/href</a></iframe><p>Let’s break down the unit test code to understand what we’ve accomplished here. 🛠️</p><p><strong>@Mock</strong>: These annotations indicate that the realmService, userRealm, and userStoreManager variables are mock objects. Instead of using real instances, Mockito will create fake versions (mocks) of these objects for testing purposes.</p><p><strong>@InjectMocks</strong>: This annotation is a Mockito annotation used to inject mock objects into the fields of the tested object. In simple words, this tells Mockito to inject the mock objects into userStoreManagerToTest. This means that realmService, userRealm, and userStoreManager will be injected into the userStoreManagerToTest instance.</p><p><strong>@BeforeEach</strong>: This annotation indicates that the setUp method should be run before each test method. It&#39;s used to set up the test environment.</p><p><strong>MockitoAnnotations.openMocks(this)</strong>: Initializes the mock objects.</p><p><strong>when(…).thenReturn(…)</strong>: In Mockito, when(...).thenReturn(...) is used to define the behavior of mock objects when specific methods are called on them.</p><ul><li>when(realmService.getUserRealm(null)).thenReturn(userRealm): When getUserRealm(null) is called on realmService, it will return userRealm.</li><li>when(userRealm.getUserStoreManager()).thenReturn(userStoreManager): When getUserStoreManager() is called on userRealm, it will return userStoreManager.</li></ul><p><strong>@Test</strong>: This annotation indicates that the method testGetUserName is a test method.</p><p>This test checks that the getUserName method in UserStoreManager correctly retrieves the username for a given user ID by using mocks to simulate the behavior of its dependencies (RealmService, UserRealm, and UserStoreManager).</p><h4>Best Practices for Mocking</h4><ul><li><strong>Use Mocks Wisely</strong>: Only mock external dependencies and keep the unit tests focused on the functionality of the unit under test.</li><li><strong>Avoid Over-Mocking</strong>: Over-mocking can make tests fragile and difficult to maintain. Only mock what is necessary for the test.</li><li><strong>Verify Interactions</strong>: Use Mockito’s verify method to ensure that the interactions with the mocks are as expected.</li></ul><p>Hope you’ve established a foundation for start writing testing using mocking by reading this blog.</p><p>Mocking is a powerful technique that, when used appropriately, enhances the reliability and robustness of your unit tests. Make sure to keep your tests focused, avoid unnecessary complexity, and always verify your mocks’ interactions. Happy testing!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=92c5704c1b09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Securing Microservices with WSO2 Identity Server 7.0]]></title>
            <link>https://medium.com/@sandushidileka2/securing-microservices-with-wso2-identity-server-7-0-315d29c20a6a?source=rss-394f4ab0ee69------2</link>
            <guid isPermaLink="false">https://medium.com/p/315d29c20a6a</guid>
            <dc:creator><![CDATA[Sandushidileka]]></dc:creator>
            <pubDate>Fri, 07 Jun 2024 16:39:44 GMT</pubDate>
            <atom:updated>2024-06-07T16:43:41.950Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UFxSBk9eK7elCYF0z_BSLg.png" /></figure><p>In today’s digital world, applications are becoming more complex and interconnected. The rise of microservices architecture has transformed how we build and manage applications. But with this new architecture comes new challenges, particularly in securing these microservices. That’s where Identity and Access Management (IAM) comes into play. Let’s dive into how IAM can secure microservices.</p><h4>What is Microservice Architecture?</h4><p>Microservices architecture breaks down applications into small, independent services that work together. Each service can be developed, deployed, and scaled independently. This flexibility makes microservices popular, but it also introduces security challenges.</p><p>How do these services securely communicate with each other? How do you ensure only authorized services and users can access certain parts of the system?</p><p>Can we do this using IAM solutions?</p><p>In simple terms, <strong>Identity and Access Management (IAM)</strong> solutions manage who has access to what within an organization, ensuring the right people and services have the right access at the right times.</p><p>Imagine an online shopping platform like eBay. It has numerous microservices: inventory, payment, shipping, user profiles, recommendations, and more. Each service needs to communicate securely with others. For example, the payment service needs to interact with the user profile service to fetch billing information.</p><p>Without proper security, a vulnerability in one service could potentially expose the entire system.</p><p><em>This is where IAM, specifically using WSO2 Identity Server 7.0, plays a crucial role.</em></p><h4><strong>WSO2 Identity Server 7.0 : A Powerful IAM Solution</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/1*NZP4bMCNxIhtBX0b5Fn4vg.png" /></figure><p><strong>WSO2 Identity Server 7.0</strong> is an open-source IAM solution that helps manage identities and secure access to applications and services. It supports various protocols like OAuth2, OpenID Connect, and SAML, making it versatile for modern applications.</p><p>Let’s see how we can apply WSO2 IS to our online shopping platform use case :</p><ol><li><strong>Service-to-Service Authentication</strong>: Each microservice needs to authenticate itself to communicate with other services. WSO2 IS can issue tokens that services use to prove their identity. When the payment service wants to talk to the user profile service, it presents a token issued by WSO2 IS. The user profile service validates this token before sharing any data.</li><li><strong>User Authentication and Authorization</strong>: When a user logs in to the shopping platform, WSO2 IS handles the authentication, ensuring the user’s identity is verified. Once authenticated, WSO2 IS issues a token that the user can use to interact with various microservices. This token includes information about the user’s permissions, ensuring they can only access authorized parts of the system.</li><li><strong>Fine-Grained Access Control with Permissions and Roles</strong>: Different users have different permissions. For example, an admin can manage the inventory, while a regular user can only view products. Using WSO2 IS 7.0.0, we can manage the permissions based on the Roles.</li></ol><h4>Service-to-Service Authentication with tokens</h4><p>Once the services are configured as Service providers in WSO2 IS, for each service provider (service), generate client credentials (Client ID and Client Secret). These credentials will be used for authentication during the OAuth 2.0 token issuance process. When one service (client) needs to access another service (resource server), it authenticates itself by presenting its client credentials (Client ID and Client Secret) to WSO2 IS.<br>WSO2 IS validates the client credentials and issues an access token if authentication is successful. The resource server can use WSO2 IS’s token validation endpoint to validate the access token. This endpoint verifies the token’s authenticity, expiration, and other security attributes. If the access token is valid, the resource server grants access to the requested resources.</p><h4>Fine-Grained Access Control with IS 7.0.0 RBAC</h4><p>In WSO2 Identity Server 7.0, Role-Based Access Control (RBAC) is a policy mechanism that governs access to resources based on roles. Users are assigned roles, and these roles determine their permissions within the system. RBAC simplifies access management by allowing administrators to define roles and associate them with specific permissions. This approach centralizes access control, making it easier to manage permissions across the organization and ensuring that users only have access to the resources they need to perform their tasks.</p><h4>Key terms in RBAC</h4><ol><li><strong>API Resources </strong>: Business, management, or organizational APIs that we can define with permissions.</li><li><strong>Permissions </strong>: The actions an application can perform on the API on behalf of the user. This is also referred to as scopes.</li><li><strong>Roles</strong>: Groups of permissions for API Resources, which can be application or organizational roles.</li><li><strong>User groups </strong>: Collections of users who have the same privileges.</li><li><strong>IDP groups </strong>: Groups from an external identity provider connected with the application.</li></ol><p>Let’s turn into our online shopping plaform example to unsertand the above key terms.</p><p>Roles:</p><ol><li>Customer and Store Manager are application roles associated with the online shopping platform.</li><li>Administrator is an organization role.</li></ol><p>Permissions:</p><ol><li>The Customer role has permissions to view products and make purchases.</li><li>The Store Manager role has permissions to view products, manage inventory, and process orders.</li></ol><p>Users:</p><ol><li>Employees of the online shopping platform’s organization are assigned the Store Manager role.</li><li>Any other user registering on the platform is assigned the Customer role.</li><li>Employees of partner stores connected to the platform are assigned the Store Manager role.</li></ol><p>When logging into the online shopping platform under these conditions:</p><ol><li>Sarah, an employee of the online shopping platform, can view products, manage inventory, and process orders.</li><li>Tom, a regular customer, can view products and make purchases.</li><li>Employees of partner stores can view products, manage inventory, and process orders within their respective stores.</li></ol><p>Now you can see how RBAC principles are used in microservice systems, making it easy to manage user access manage access control across your services.</p><p>With the WSO2 Identity Server 7.0.0, managing security in a microservices architecture has become significantly easier and more efficient.</p><p>Benefits of Using WSO2 IS</p><ul><li><strong>Enhanced Security</strong>: Centralized authentication and authorization reduce the risk of unauthorized access.</li><li><strong>Scalability</strong>: Microservices can scale independently without compromising security.</li><li><strong>Flexibility</strong>: Supports multiple authentication protocols, making it adaptable to different environments.</li><li><strong>Compliance</strong>: Helps meet regulatory requirements by providing detailed access logs and audit trails.</li></ul><p>In a world where microservices architecture is becoming the norm, securing these services is paramount. IAM, particularly using solutions like WSO2 Identity Server, provides the necessary tools to manage authentication and authorization effectively. By implementing WSO2 IS in your microservices architecture, you can ensure secure, scalable, and compliant interactions between services and users. This not only protects your application but also builds trust with your users.</p><p>So, as you build the next big thing in tech, remember that a robust IAM system is your best ally in the quest for security and efficiency.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=315d29c20a6a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Trying out Federated Authentication with WSO2 Identity Server]]></title>
            <link>https://medium.com/@sandushidileka2/trying-out-federated-authentication-with-wso2-identity-server-4c633bce9dad?source=rss-394f4ab0ee69------2</link>
            <guid isPermaLink="false">https://medium.com/p/4c633bce9dad</guid>
            <category><![CDATA[federated-authentication]]></category>
            <category><![CDATA[identity-federation]]></category>
            <category><![CDATA[saml2-sso]]></category>
            <dc:creator><![CDATA[Sandushidileka]]></dc:creator>
            <pubDate>Sun, 11 Dec 2022 16:57:37 GMT</pubDate>
            <atom:updated>2022-12-11T16:57:37.009Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/920/1*f2LarYB5DAuzHPg98UF6bQ.jpeg" /></figure><p><strong>Identity Federation</strong> is the process of authenticating users to our applications with an external identity provider. This allows users to use their user account from one application to different applications. Thus we do not need to remember different sets of credentials for the different applications we use.</p><p>SAML2 Web SSO, OAuth2, Facebook, Google, Twitter, SMS OTP, Email OTP are some of the Federated Authenticators with latest IS versions.</p><p><strong>First we will have a look at how Federated authentication works briefly.</strong></p><ul><li>When a user tries to login to an application, the service provider component finds the all set of Federated Authenticators that are registered with the service provider.</li><li>The user can select one identity provider and provide the credentials.</li><li>The identity provider verifies the user and authorizes the user to the service provider application.</li></ul><p><strong>Let’s look into how we can configure Identity Federation scenario in WSO2 Identity Server.</strong></p><p>In this article, I am using the SAML protocol and saml2-web-app-pickup-dispatch application to explain this scenario.</p><ol><li><strong>Build the saml2-web-app-pickup-dispatch application from the source</strong></li></ol><ul><li>Clone the WSO2 <a href="https://github.com/wso2/samples-is">sample-is</a> repository.</li><li>Run the below command from the &lt;IS_SAMPLE&gt;/saml2-sso-sample directory</li></ul><pre>mvn clean install</pre><ul><li>After the successful build you can find the sample applications inside the target directory.</li><li>Copy the saml2-web-app-pickup-dispatch.com.war file into &lt;tomcat_home&gt;/webapps folder.</li><li>Start the tomcat server</li></ul><p>Here, I am using two Identity Servers in this scenario, One for serving to the SAML application and other for serving as an External Identity Provider.</p><ul><li>IS1 — WSO2 Identity Server that serves for SAML application</li><li>IS2 — WSO2 Identity Server that serve as an external Identity Provider for IS1</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*7huSI6V5VvgqtaevM3dEvA.png" /><figcaption>Figure 1 : Example scenario for Federated Authentication</figcaption></figure><p><strong>2. Configure Service provider(SP1) and Identity Provider (IDP1) in IS1</strong></p><ul><li>Download the latest Identity Server from <a href="https://github.com/wso2/product-is/releases">here</a> and start the server by running the wso2server.sh file inside &lt;IS1_HOME&gt;/bin folder.</li><li>Access to the <a href="https://localhost:9443/carbon/">https://localhost:9443/carbon/</a> and login to the management console.</li><li><strong>Add Service Provider (SP1)</strong><br>- Add a Service Provider with name and description and Register it.<br>- Go to the SAML2 Web SSO Configuration section under Inbound Authentication Configuration and click on configure.<br>- Add the below configurations and click on Register.</li></ul><blockquote>Name : SP1</blockquote><blockquote>Issuer : saml2-web-app-pickup-dispatch.com</blockquote><blockquote>Assertion Consumer URLs : <a href="http://localhost.com:8080/saml2-web-app-pickup-dispatch.com/home.jsp">http://localhost.com:8080/saml2-web-app-pickup-dispatch.com/home.jsp</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lmKMxG6H9ukcdRucgirUeg.png" /></figure><ul><li><strong>Add Identity Provider (IDP1)</strong><br>- Click on the “Add” button under Identity Providers.<br>- Enter the name as below and configure the Federated Authenticators section as follows.<br>- Enable SAML2 Web SSO</li></ul><blockquote>Name : IDP1</blockquote><blockquote>Service Provider Entity ID : Primary</blockquote><blockquote>Identity Provider Entity ID: Secondary</blockquote><blockquote>SSO URL: <a href="https://localhost:9444/samlsso">https://localhost:9444/samlsso</a></blockquote><blockquote>ACS URL: <a href="https://localhost:9443/commonauth">https://localhost:9443/commonauth</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BId1_Zku8eoSJnufdXKWQA.png" /></figure><ul><li>Add this configured IDP1 as the Federated Authenticator in the SP1<br>- Click on the “Edit” button in the SP1 and expand Local &amp; Outbound Authentication Configuration to configure Federated Authentication. <br>- Click on Advanced configuration and add the Authentications steps as below. Here in this scenario I am using Authentication steps, one is username &amp; password and other is Federated authenticator IDP1.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*twpPyHc2P7mrI-AGRhL2GQ.png" /></figure><p><strong>3. Configure Service provider(SP2) in IS2</strong></p><ul><li>To start the IS2 in a different port (port 9444), Download the the latest Identity Server from <a href="https://github.com/wso2/product-is/releases">here</a> to a new directory and Add the below config to &lt;IS2_HOME&gt;/components/conf/deployment.toml file.</li></ul><pre>[server]<br>offset = 1</pre><ul><li>Start the server by running wso2server.sh inside &lt;IS2_HOME&gt;/bin folder.</li><li>Access to the <a href="https://localhost:9443/carbon/">https://localhost:9444/carbon/</a> and login to the management console.</li><li><strong>Add Service Provider (SP2)<br>- </strong>Add a service provider with a proper name and configure the SAML2 Web SSO Configuration section under Inbound Authentication Configuration as below.</li></ul><blockquote>Name : SP2</blockquote><blockquote>Issuer : Primary (Service Provider Entity ID of IS1)</blockquote><blockquote>Assertion Consumer URLs : <a href="https://localhost:9443/commonauth">https://localhost:9443/commonauth</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I4uL3ramW6Upo55zRI8f6g.png" /></figure><p>Yeah! Now we are done with all the configurations 😎.</p><p>Now it’s time to try out this scenario.</p><p><strong>4. Test this example scenario.</strong></p><ul><li>First need to create a user in the IS2.</li><li>Access to the pickup dispatch application using <a href="http://localhost.com:8080/saml2-web-app-pickup-dispatch.com">http://localhost.com:8080/saml2-web-app-pickup-dispatch.com</a></li><li>Click on “Sign in with IDP1” and Provide the credentials of created user.</li><li>Now attempt to access the pickup dispatch application.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*sLnivKJy6ok36oz2Yz2DxA.gif" /></figure><p>Congratulations !! Now all of you know how to try out the Federated Authentication in WSO2 Identity Server.</p><h3>Resources</h3><ol><li><a href="https://is.docs.wso2.com/en/latest/guides/identity-federation/configure-saml-2.0-web-sso/">https://is.docs.wso2.com/en/latest/guides/identity-federation/configure-saml-2.0-web-sso/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4c633bce9dad" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configure and Test WSO2 IS product on Oracle19c DB using Docker Container]]></title>
            <link>https://medium.com/@sandushidileka2/configure-and-test-wso2-is-product-on-oracle19c-db-using-docker-container-b123bdcc8695?source=rss-394f4ab0ee69------2</link>
            <guid isPermaLink="false">https://medium.com/p/b123bdcc8695</guid>
            <dc:creator><![CDATA[Sandushidileka]]></dc:creator>
            <pubDate>Mon, 15 Aug 2022 14:12:35 GMT</pubDate>
            <atom:updated>2022-08-15T14:16:13.333Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/687/1*fcAG1h7F04ogrvGiDhGR9Q.jpeg" /></figure><p>An Oracle <strong>database</strong> is a collection of data treated as a unit. Problems of Information management are mainly handled from the database. In simple words, we are using a database in a product for the purpose of storing and retrieving data. Oracle Database is the first database designed for enterprise grid computing, the most flexible and cost effective way to manage information and applications.</p><p>WSO2 Identity Server is shipped with an embedded H2 database for storing data. These default databases <strong>Identity database</strong>, <strong>Shared database,Carbon database and Workflow database </strong>are located in the &lt;IS_HOME&gt;/repository/database directory of the product pack. The default configurations for databases are defined in the &lt;IS_HOME&gt;/repository/conf/deployment.toml.</p><p>We recommend that to use industry-based RDMSs such as Oracle, PostgreSQL, MySQL, MSSQL, etc for production environments. The database scripts for creating tables for relevant database tables are stored in the &lt;IS_HOME&gt;/dbscripts for each database type.</p><p>From this blog, my objective is to explain how to set up an Oracle19c docker container and test WSO2 identity Server step by step.</p><p>Let’s get started !</p><p><strong>Install Oracle Database 19c in a docker container</strong></p><ol><li>Go to <a href="https://github.com/oracle/docker-images">https://github.com/oracle/docker-images</a><em> </em>URL and copy the clone URL.</li><li>Open a terminal and change the directory to where you want to clone the git repository.</li><li>To clone the git repository, use the below command.</li></ol><pre> git clone <a href="https://github.com/oracle/docker-images"><em>https://github.com/oracle/docker-images</em></a></pre><p>4. Change the directory to docker-images (where all the directories for Oracle software docker images files).</p><pre>cd docker-images</pre><p>5. Change the directory to Single Instance inside Oracle Database ( here we are installing Single Instance for Oracle19c database).</p><pre>cd OracleDatabase/SingleInstance</pre><p>6. Change the directory to dockerfiles ( There is a folder for each version).</p><pre>cd dockerfiles</pre><p>7. Change the directory to 19.0.3 ( for Oracle19c).</p><pre>cd 19.3.0</pre><p><em>8. </em>Download the Oracle19c source from the official website <a href="https://www.oracle.com/database/technologies/oracle-database-software-downloads.html">https://www.oracle.com/database/technologies/oracle-database-software-downloads.html</a></p><p>9. Copy the downloaded zip file to current directory (docker-images/OracleDatabase/SingleInstance/dockerfiles/19.3.0).</p><pre>cp ~/Documents/Software/Oracle/Oracle_19c/LINUX.X64_193000_db_home.zip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-eGzp7S7dEPE7nc3mEbKEQ.png" /></figure><p>10. Use the below command to exclude blank lines and comments from the response file. From this file Oracle software will be installed.</p><pre>grep -v ^# db_inst.rsp | grep -v ^$</pre><p><em>The values for Oracle Base location, Oracle Home location, and Oracle Edition will be set via environment variables.</em></p><p>11. Use the below command to exclude blank lines and comments from the dbca response file. From this response file, a container database with one pluggable database will be installed.</p><pre><em>grep -v ^# dbca.rsp.tmpl | grep -v ^$</em></pre><p><em>The values for Pluggable database name, Oracle sid, and sys password will be set via environment variables.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WguBpUczcb8ms-UH2tjhdw.png" /></figure><p>12. Execute the buildDockerImage.sh file from <strong>dokcerfiles directory.</strong></p><pre>./buildContainerImage.sh -v 19.3.0 -e</pre><p>Specify the version number with -v option and -e for enterprise edition image.</p><p>After a successful installation, it displays below message.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*innTdwC9Bfq4BA0AbBhRtg.png" /></figure><p>13. Create a docker container with the downloaded image.</p><p>-p. : Publish port in the form of local port:docker container port.</p><p>-e : Set environment variable</p><p>-v : Bind mount a volume</p><p>-d : Detach. Run container in background and print container ID</p><p>oracle/database:19.3.0-ee : Name of image.</p><pre>docker run --name oracle19c -p 1521:1521 -p 5500:5500 -e ORACLE_PDB=orcl -e ORACLE_PWD=password -e ORACLE_MEM=2000 -v /opt/oracle/oradata -d oracle/database:19.3.0-ee</pre><p>14. Use the below command to check the status of the docker container.</p><pre>docker ps</pre><p>15. This container should be up. If it is not, you can start the container using below command.</p><pre>docker start &lt;conatiner_id&gt;</pre><p><strong>Login to created Oracle19c container</strong></p><ol><li>Execute the following command to login to the container. Change the name oracle19c if you used another name for the container in creation.</li></ol><pre>docker exec -it oracle19c “bash”</pre><p>2. Login to the SQL terminal.</p><pre>sqlplus sys@ORCLCDB as sysdba</pre><p><strong>Create a new user</strong></p><p>Since Oracle database is bit different from other databases, we have to create users and grant some permissions for the users.</p><ol><li>Before Create the client, run the below command with “_ORACLE_SCRIPT” param to true.</li></ol><pre>alter session set “_ORACLE_SCRIPT”=true;</pre><p>2. Create user with password.</p><pre>create user regadmin identified by password;</pre><p>3. Grant permissions</p><pre>GRANT CREATE SESSION TO regadmin;<br>GRANT CREATE SESSION, CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER, CREATE PROCEDURE TO regadmin;<br>GRANT DBA to regadmin;<br>ALTER USER regadmin quota 100M on USERS;</pre><p><strong>Connect to database and created tables via DBeaver</strong></p><ol><li>Create a new Database Connection by selecting Oracle DB type and Click Next button.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*P9plcGdI-0-xjsdzl4JRqA.png" /></figure><p>2. Provide the details for the connection and Click on Finish button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*M4mempcU2Ys9hwhWqVpY5Q.png" /></figure><p>3. Open a SQL script from the schema and Paste the oracle.sql scripts from the &lt;IS_HOME&gt;/dbscripts. Replace the “/” with “;” and Execute the script.</p><p>Then the relevant tables will be created.</p><p><strong>Setting up the IS server with the Oracle19c database</strong></p><ol><li>Add the following configurations to deployment.toml file.</li></ol><p>( Note : The below configurations are based on Product IS 5.11.0 . If you are using versions above 5.9.0, you can check on the deployment.toml file in the relevant pack, But if you are using versions below 5.9.0, you can check on relevant <em>xml </em>files<em>.)</em></p><ul><li>If you are using Oracle database as Shared DB, use below configuration.</li></ul><pre>[database.shared_db]<br>type = “oracle”<br>hostname = “localhost”<br>sid = “ORCLCDB”<br>username = “regadmin”<br>password = “password”<br>port = “1521”</pre><ul><li>If you are using Oracle database as Identity DB, use the below configuration.</li></ul><pre>[database.identity_db]<br>type = “oracle”<br>hostname = “localhost”<br>sid = “ORCLCDB”<br>username = “regadmin”<br>password = “password”<br>port = “1521”</pre><p>2. Download the JDBC connector from <a href="https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html">https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html</a> and copy the JAR file to &lt;IS_HOME&gt;/repository/components/lib.</p><p>3. Start the server.</p><p>Now, We can start testing WSO2 IS product with Oracle19c Database.</p><p>Happy Testing ! 😆🤗</p><h3>References</h3><ol><li><a href="http://dillidba.blogspot.com/2020/07/install-oracle-database-19c-in-docker.html">http://dillidba.blogspot.com/2020/07/install-oracle-database-19c-in-docker.html</a></li><li><a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/index.html">https://docs.oracle.com/en/database/oracle/oracle-database/19/index.html</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b123bdcc8695" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understand OAuth with a real life example]]></title>
            <link>https://medium.com/@sandushidileka2/understand-oauth-with-a-real-life-example-40591c6e6d2c?source=rss-394f4ab0ee69------2</link>
            <guid isPermaLink="false">https://medium.com/p/40591c6e6d2c</guid>
            <category><![CDATA[oauth]]></category>
            <category><![CDATA[oauth2]]></category>
            <dc:creator><![CDATA[Sandushidileka]]></dc:creator>
            <pubDate>Thu, 28 Jul 2022 01:50:24 GMT</pubDate>
            <atom:updated>2022-07-28T02:02:25.355Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*uSzWixc6vRog3ZOTlImg1A.jpeg" /></figure><p>Hi folks!</p><p>Let’s say a third-party application asks for your username and password to access and edit the documents in your Google Drive. Do you give those? Is it secure to give the username and password?</p><p><strong>Please don’t do that</strong>. It is not secure to do. By giving your credentials to a third party application means they can act like you. They have the same access rights that you have.</p><p>So, Do we need to restrict scenarios like this?</p><p>No, We have a solution for this. Here this is the place where <strong>“Access Delegation”</strong> comes into the picture. Access delegation means allowing third party users to access your resources on behalf of you with some restrictions.</p><p><strong><em>OAuth is an industry based protocol to achieve “Access Delegation”.</em></strong></p><p>Here, this blog for you to take the first step to learn OAuth.</p><p>Before going to OAuth let’s see this real life scenario.</p><p>Think about a situation like this, in your home. Your Mom has a book cupboard and asks you to bring a book for her from that cupboard.</p><p>Here your Mom is like<strong> Resource Owner</strong> and You are like the <strong>Client Application. </strong>Your Mom wants to do something from you on behalf of her.</p><blockquote><strong>Mom</strong> : Hey Son! Can you bring a book from the cupboard on behalf of me ? Take the key from Dad</blockquote><blockquote><strong>You</strong> : Okay Mom <em>😊</em></blockquote><p>Mom keeps the cupboard key with Dad. Then your Dad is the <strong>Authorization Server </strong>where you have to get the key. So, you have to walk to Dad.</p><blockquote><strong>You</strong> : Hey Dad! Mom asked me to take the cupboard key from you. Can you please give it to me?</blockquote><p>Dad asks Mom loudly to get the permission.</p><blockquote><strong>Dad</strong> : Mom, Shall I give the key to him?</blockquote><blockquote><strong>Mom</strong> : Yes, please</blockquote><p>Dad speaks to you and gives the key. The key of the cupboard is the <strong>Access key</strong>.</p><blockquote><strong>Dad</strong> : Here, this is the key.</blockquote><p>With the key you can access the the cupboard which is the <strong>Resource Server</strong> in this case. You can open the cupboard using the key, take the relevant book and give it to your mom.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CJwkYexbwqjH8n00I7XfaQ.png" /></figure><p>Basically OAuth 2.0 works similarly. Now let’s move into OAuth.</p><h3><strong>What is OAuth ?</strong></h3><p>OAuth is <strong>an authorization framework</strong> that <em>enables a third-party application to obtain a limited access to an HTTP service</em> that was introduced on 3rd of October 2007.</p><p>In simple words, OAuth grants access to a third party application to perform limited actions on your protected resources on behalf of you without providing your username or passwords.</p><p><strong>OAuth 1.0</strong></p><p>OAuth 1.0 was designed based on two proprietary protocols : Flickr’s authorization API and Google’s AuthSub.</p><p>OAuth 1.0 defines 3 roles.</p><ul><li><strong>Consumer — </strong>Third party application that making requests to the protected resources.</li><li><strong>User</strong> — Owner of the protected resources who can grant the access to the resources.</li><li><strong>Service Provider </strong>— Authorization and resource server.</li></ul><p>Simply, OAuth Consumer uses the Access tokens issued by Service provider to access the resources on behalf of User.</p><p>Without going more details about OAuth 1.0, Let’s move to OAuth 2.0 which is widely used now.</p><p><strong>OAuth 2.0</strong></p><p>OAuth 2.0 is completely rewritten of OAuth 1.0 that mainly focused on simplifying client side development and this is <strong>not backward compatible with OAuth 1.0 </strong>.</p><p>OAuth 2.0 defines 4 roles that are involved in this authorization process.</p><ul><li><strong>Resource Owner </strong>— Owner of the protected resources who can grant the access to the resources.</li><li><strong>Client</strong> <strong>Application</strong>— Third party application that making requests to the protected resources.</li><li><strong>Authorization Server </strong>— The server authenticating the resource owner and issues access tokens.</li><li><strong>Resource server </strong>— The server hosting the protected resources.</li></ul><p>In OAuth 2.0, there are different ways to authorize the access to protected resources using different security credentials. We called them as <strong>grant types</strong>. These are the four grant types defined in OAuth 2.0 specification.</p><ul><li><strong>Authorization code flow —</strong>used by public and confidential clients to exchange the Authorization code to get the access token</li><li><strong>Implicit flow —</strong> access tokens are returned directly without an authorization code, not recommended to use due to security issues</li><li><strong>Resource owner password flow — </strong>exchange user’s credentials to obtain the access token, not recommended to use due to security issues</li><li><strong>Client Credentials flow — </strong>exchange the client credentials (client id and client secret) outside of the context of user to obtain the access token</li></ul><p>Let’s see how the process works with the<strong> Authorization code</strong> grant type.</p><p>As the below diagram illustrates, First the <strong>Resource Owner(User)</strong> needs to login for the <strong>Client Application</strong>. And next, the Client Application redirects the Resource Owner to the<strong> Authorization Server</strong> with <strong>Authorization Request + scopes</strong> <em>( what kind of access we needed for the application ). </em>Then the Authorization Server asks the <strong>Consent</strong>. After the user provides the consent, the Authorization Server sends an <strong>Authorization Code</strong> to the Client Application.</p><p>Then Client Application can use this code to request an Access Token. <strong>Access Token</strong> is the credentials that is used to access the protected resources. So, now the Client application can talk with the <strong>Resource Server</strong> till the access token expires. After it expires we can use the <strong>Refresh token</strong> to obtain a new Access Token.</p><p>So, This is the process in briefly in Authorization Code grant type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n30HXxqnG0PiKZVLjliytg.png" /><figcaption>Authorization code grant type flow</figcaption></figure><p>Let’s look at what are the differences between OAuth 1.0 and OAuth 2.0 .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*_n1QIevWyakSvPmjTokYYg.png" /></figure><p>Now It’s time for<strong> OAuth 2.1</strong> also.</p><p><strong>OAuth 2.1</strong></p><p>Even though OAuth 2.0 is the widely used version for access delegation, OAuth 2.1 is<strong> </strong>in progress<strong> to simplify and consolidate some common features</strong> in OAuth 2.0.</p><p>Let’s briefly see what are the changes from OAuth 2.1.</p><ul><li><a href="https://oauth.net/2/pkce/"><strong>PKCE</strong></a> is required in the most commonly used <strong>Authorization code</strong> grant type to make this flow more secure.</li><li><strong>Resource owner password</strong> and<strong> Implicit</strong> grant type are omitted from this OAth 2.1 version.</li><li>Passing the Bearer token as a Query string in the URI is omitted.</li><li>Instead of long lived refresh token, from OAuth 2.1 provides : <strong>One-time only refresh token</strong> — that can use only once to retrieve the access token and <strong>Sender constrained refresh token</strong> — that tied to the sender with cryptographic binding.</li><li>Mandatory to use exact string matching when comparing redirect URI.</li></ul><p>This is a quick glance at OAuth. Hope all you took the first step into understanding OAuth.</p><p>I will go into OAuth 2.0 flow in detail in my next blog. Stay tuned! 🙂</p><p>Thanks for reading !</p><h3><strong>References</strong></h3><ol><li><a href="https://www.ibm.com/docs/en/tfim/6.2.2.7?topic=overview-oauth-10-workflow">https://www.ibm.com/docs/en/tfim/6.2.2.7?topic=overview-oauth-10-workflow</a></li><li><a href="https://oauth.net/2.1/">https://oauth.net/2.1/</a></li><li><a href="https://www.oauth.com/oauth2-servers/differences-between-oauth-1-2/">https://www.oauth.com/oauth2-servers/differences-between-oauth-1-2/</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40591c6e6d2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>