<?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 Engin Güngör on Medium]]></title>
        <description><![CDATA[Stories by Engin Güngör on Medium]]></description>
        <link>https://medium.com/@engin.gungor14?source=rss-c16c20998f73------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HhcgSkNWjC3h4hoz61ReUg.jpeg</url>
            <title>Stories by Engin Güngör on Medium</title>
            <link>https://medium.com/@engin.gungor14?source=rss-c16c20998f73------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 12:39:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@engin.gungor14/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 Long Should You Run an A/B Test?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@engin.gungor14/how-long-should-you-run-an-a-b-test-1d3ad44693a8?source=rss-c16c20998f73------2"><img src="https://cdn-images-1.medium.com/max/827/1*ClMabu8GeH5Ypat7bgLs6Q.png" width="827"></a></p><p class="medium-feed-snippet">In the previous part, we assigned users to groups and measured the metrics of each group. So far, so good. But how long should we run this&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@engin.gungor14/how-long-should-you-run-an-a-b-test-1d3ad44693a8?source=rss-c16c20998f73------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@engin.gungor14/how-long-should-you-run-an-a-b-test-1d3ad44693a8?source=rss-c16c20998f73------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d3ad44693a8</guid>
            <category><![CDATA[sample-size]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[metrics]]></category>
            <category><![CDATA[ab-testing]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Engin Güngör]]></dc:creator>
            <pubDate>Sun, 18 Oct 2026 18:23:19 GMT</pubDate>
            <atom:updated>2026-10-18T18:23:19.896Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Splitting Users Fairly: Hashing, SRM and A/A Tests]]></title>
            <link>https://medium.com/@engin.gungor14/splitting-users-fairly-hashing-srm-and-a-a-tests-86b3cbc09aa1?source=rss-c16c20998f73------2</link>
            <guid isPermaLink="false">https://medium.com/p/86b3cbc09aa1</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[ab-testing]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Engin Güngör]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 08:55:13 GMT</pubDate>
            <atom:updated>2026-10-12T08:55:13.148Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been working as a Senior Software Developer on an e-commerce A/B Testing platform for the past two years. We built this platform from scratch, and it has evolved over time based on our needs and experiences.</p><p>Of course, I cannot share all the details of the solutions we developed in-house. However, in this series, I will talk about the main topics and challenges I would consider if I were building an A/B Testing platform from scratch.</p><p>I’ve shared the complete implementation and simulations in my <a href="https://github.com/esgungor/ab-testing-notebooks">GitHub repository</a>, so you can explore the code and reproduce the results yourself. Let’s start by looking at the assignment distribution.</p><h3>Assigning Users</h3><p>An A/B Testing platform can have many different features. It is usually connected to a configuration platform, and combining configurations with experiments is a common requirement.</p><p>However, in this series, we will mainly focus on the A/B testing and statistics parts. We will start with one of the most basic questions in an A/B Testing platform: <strong>How do we assign users to experiments?</strong></p><p>This will be our starting point as we build an A/B Testing platform from scratch.</p><p>One of the most common approaches in the industry is to use a hash function with a salt to assign users to different groups.</p><p>The basic idea is simple: we combine the user’s ID with a salt, hash the result, and use the hash value to decide which group the user belongs to.</p><p>For example, if we want to split users into two groups, we can use:</p><pre>MD5(UserId + Salt) % 2</pre><pre>0 → Group A<br>1 → Group B</pre><p>This gives us a simple and deterministic way to assign users. The same user will always be assigned to the same group as long as we use the same User ID and salt.</p><p>This approach is simple, but there are some important questions behind it. How do we make sure users are distributed evenly? What happens when we have more than two groups? And how can we safely change the percentage of users in each group?</p><p>I’ve shared the code in my notebook to show how this can be implemented. The example distribution is also included below.</p><pre>B --&gt; 50057<br>A --&gt; 49943</pre><p>The result is not exactly 50,000 / 50,000 — and <strong>it should not be</strong>. If every user behaves like an independent coin flip, the number of users in a group follows a Binomial(N, 0.5) distribution. Its standard deviation is `√N / 2 ≈ 158`.</p><p>Of course, we don’t have to split users into just two groups. We can also divide the hash space into 100 buckets to support different traffic allocations and gradual ramping. For example, we might start by exposing only 10% of users to an experiment and gradually increase that percentage. We’ll explore traffic allocation and ramping in more detail in a later part of this series.</p><p><strong>Why Should Each Experiment Have Its Own Salt?</strong></p><p>We have seen that combining a user ID with a salt gives us a deterministic assignment. But what happens if we use the same salt for every experiment?</p><p>Imagine running two experiments with the same salt and the same traffic allocation. Since the hash inputs are identical, users will be assigned to exactly the same groups in both experiments.</p><p>This creates an unnecessary correlation between experiments. For example, users in Group A of one experiment will also be in Group A of the other experiment.</p><p>To avoid this, each experiment should have its own salt. One simple approach is to generate the salt using the experiment ID.</p><p>However, there is an important distinction: <strong>the salt should change between experiments, not during an experiment.</strong></p><p>If we change the salt while an experiment is running, the same user may be assigned to a different group. This breaks the consistency of the user experience and can compromise the experiment results.</p><p>The rule is simple: use a unique salt for each experiment and keep it stable throughout its lifetime.</p><p>So the real question is: <strong>is the difference we see inside this normal random variation?</strong></p><h3>Sample Ratio Mismatch (SRM)</h3><p>We cannot expect an exact 50/50 split. The question is whether the difference is normal random variation or a sign of a problem with our assignment logic. This is where <strong>SRM (Sample Ratio Mismatch)</strong> comes into play.</p><p>A simple way to understand this is to look at the expected variation. With 10,000 users in a 50/50 experiment, the standard deviation of each group is 50 users. If we observe a 5,200 / 4,800 split, Group A has 200 more users than expected. That’s 4 standard deviations away from the expected value, which is very unlikely under normal random variation.</p><p>One common way to check this is the <strong>Chi-Square Goodness-of-Fit Test</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*8zBfWKukVLTYSrZbtAvHtw.png" /></figure><p>For our 5,200 / 4,800 example, the result is:</p><pre>χ² = 16<br>p-value ≈ 0.000063</pre><p>In Python, we can calculate this with a single line:</p><pre>from scipy import stats<br>stats.chisquare([5200, 4800])<br># statistic=16.0, pvalue≈6.3e-05</pre><p>For SRM checks, a threshold of <strong>p &lt; 0.001</strong> is commonly used. If the p-value falls below this threshold, we should investigate the experiment because the observed distribution is unlikely to be explained by random variation alone.</p><p>Now, let’s look at our own result:</p><pre>Group A → 49,943<br>Group B → 50,057</pre><p>For 100,000 users, we expect 50,000 users in each group. The difference of 57 users is only about 0.36 standard deviations.</p><p>The Chi-Square statistic is approximately 0.13, with a p-value of about 0.72. This result does not indicate an SRM issue.</p><p>The goal here is not to go deep into statistical testing. The important point is that <strong>we should not judge a traffic split just by looking at the numbers</strong>. We need a statistical check to understand whether the difference is expected or suspicious.</p><h3><strong>A/A Testing</strong></h3><p>Now that we have divided our users into two groups, we are almost ready to measure the impact of our change. But first, we need to make sure that our user assignment works correctly.</p><p>In the previous step, we used the <strong>Sample Ratio Mismatch (SRM)</strong> check to confirm that our groups have the expected number of users. However, having balanced groups does not always mean that our experiment is ready. We also need to check whether both groups behave similarly when they receive the same experience.</p><p>This is where <strong>A/A testing</strong> comes in.</p><p>In an A/A test, both groups see exactly the same experience. Since there is no real difference between them, we expect their results to be similar. Of course, we may still see small differences because of random variation.</p><p>An A/A test helps us answer two important questions:</p><ul><li>Is our user assignment and measurement process working correctly?</li><li>How much difference can we see between two groups just by chance?</li></ul><p>For an e-commerce platform, two useful metrics to start with are <strong>Conversion Rate (CR)</strong> and <strong>Gross Merchandise Value (GMV)</strong>.</p><p>At the user level, conversion is a binary metric: a user either places an order or does not. GMV, on the other hand, is a continuous metric that represents the total value of orders.</p><p>We will not explore the statistical differences between these metric types in this article, but understanding them will become important in the next parts of this series.</p><p>To run an A/A test, we need some data. Since I can’t share real data, I created a mock dataset that looks like typical e-commerce traffic. You can find the full code in the notebook.<br><br>We use the same 100,000 users from the previous sections, with the same group assignment. For each user, we create two values:</p><ol><li><strong>Did the user place an order? (CR)<br></strong>Every user places an order with a probability of 3%. You can think of it as a weighted coin flip for each user: 3% heads (“ordered”), 97% tails (“did not order”). In our dataset, 2,942 users (2.9%) placed an order. This is our conversion rate.</li><li><strong>How much did the user spend? (GMV)<br></strong>If a user placed an order, we give them an order value. Otherwise, their GMV is 0.<br>Real order values are not evenly distributed. Most orders are small or medium, but a few are very large. To create this shape, we use a log-normal distribution. It is a common choice for money values because it has no negative values and it has a long tail on the right side. We set the typical (median) order value to 80.</li></ol><pre>converted = rng.random(N_USERS) &lt; 0.03                         # 3% of users place an order<br>order_value = rng.lognormal(np.log(80), 1.0, N_USERS)          # median 80, long right tail<br>gmv = np.where(converted, order_value, 0.0)                    # GMV is 0 for users without an order</pre><ul><li>The result looks like real e-commerce data:</li><li>The median order value is about 80, but the largest order is about 2,850, around 35 times bigger.</li><li>The top 10% of buyers bring 38% of the total GMV.</li><li>The average GMV per user is only 3.80, because most users spend nothing.</li><li>This long tail is important. A few large orders can move the average a lot, and this makes GMV a much noisier metric than CR. We will see this clearly in the A/A test.</li></ul><p>First, let’s run one A/A test with our own assignment from the previous sections, for both CR and GMV. Next to each lift, we also show the noise band: the range where the lift will most likely fall when there is no real effect (1.96 × standard error). If the observed lift is inside the band, we cannot say it is different from noise.<br><br>— CR, 10,000 users: lift = +1.7%, noise band = ±22.7%<br>— CR, 100,000 users: lift = +4.2%, noise band = ±7.3%<br>— GMV, 10,000 users: lift = +42.8%, noise band = ±53.3%<br> — GMV, 100,000 users: lift = +1.3%, noise band = ±11.8%<br><br>All four results are inside their bands, so none of them is significant. But two things stand out.<br><br>First, more users means a narrower band. For both metrics, the band becomes about 3 to 4.5 times narrower when we go from 10,000 to 100,000 users.<br><br>Second, the metric itself affects the band. With the same users, GMV’s band is about two times wider than CR’s. For CR, each user is just 0 or 1. For GMV, we have two kinds of uncertainty: whether the user buys, and how much they spend. On top of that, a few very large orders can move the average a lot. In statistics, this “how much the values spread from user to user” is called variance. The higher the variance of a metric, the wider its noise band. So it is not about the data type itself, but about the variance of the metric.<br><br>Variance will be one of the key ideas in this series. In the next parts, we will look at it in more detail and see how we can reduce it to make our experiments more sensitive.<br><br>Now look at the GMV result with 10,000 users again. Both groups saw exactly the same thing, but group B shows a 42.8% higher GMV. Imagine seeing this number on a dashboard: many people would celebrate it. But the noise band shows that, with 10,000 users, a GMV lift up to ±53% can easily come from pure chance.</p><p>So far, everything looks OK. All four results are inside their noise bands, and none of them is significant. This is exactly what we expect from an A/A test: both groups saw the same thing, and our test did not find a difference.<br><br>But one A/A test is not enough to trust our setup. A single test can look fine just by luck. What we really want to know is: if we run many A/A tests, how often does our test say “significant” when there is no effect? If our assignment and our test work correctly, this should happen in about 5% of the tests, because p &lt; 0.05 means exactly that.</p><p>— CR, 10,000 users: false positive rate = 4.5%, 95% of lifts between −21% and +24%<br>— CR, 100,000 users: false positive rate = 5.3%, 95% of lifts between −7% and +8%<br>— GMV, 10,000 users: false positive rate = 4.5%, 95% of lifts between −35% and +56%<br>— GMV, 100,000 users: false positive rate = 4.5%, 95% of lifts between −11% and +12%</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1oT-EJ9hYt0qZWR3g1swdg.png" /></figure><p><strong>What do these results tell us?</strong><br><br>1. <strong>Our setup works.</strong> In all four cases, the false positive rate is close to 5%. When there is no effect, our test says “significant” about 1 in 20 times, as expected. In our simulations, the z-test maintains a false positive rate close to 5%, even with skewed GMV data. However, this result depends on the sample size and the underlying distribution<br><br>2. <strong>More users do not reduce false positives</strong>. The false positive rate is about 5% with both 10,000 and 100,000 users. The test already takes the sample size into account: with fewer users the noise band is wider, so the test asks for a bigger difference before it says “significant”. (This is only true if we look at the result once, at the end of the experiment. Checking it every day is a different problem, and we will cover it in a later part.)<br><br><strong>3. One experiment already tells us the size of the noise. </strong>With 100,000 users, 95% of the GMV lifts in 2,000 tests fall between −11% and +12%. This is very close to the noise band we calculated from a single experiment (±11.8%). So we don’t need to run 2,000 A/A tests every time: the noise band of one experiment gives us a good estimate.</p><h3>Wrapping up</h3><p>In this first part, we started with a simple one-liner, MD5(UserId + Salt) % 2, and saw that there is a lot behind it. Here are the main points:</p><ul><li>Hash + salt is a simple and reliable way to assign users. Use a stable hash function like MD5, not your language’s built-in hash, so that every service gets the same result. Since the assignment is deterministic, we can calculate a user’s group without storing every assignment. However, some scenarios may require us to persist assignments to maintain consistency.</li><li>Every experiment needs its own salt. If two experiments share the same salt, they split users in exactly the same way. Generating the salt from the experiment ID solves this by design.</li><li>Always check for SRM. A split is never exactly 50/50, but a statistical check tells us if the difference is normal or a sign of a bug.</li><li>Test your assignment with an A/A test. Balanced group sizes are not enough; the groups must also behave the same way. In our A/A tests, the false positive rate stayed close to 5%, which means our setup works.</li><li>Read every lift together with its noise band. Even with no real effect, we saw a +42.8% GMV lift. The width of the noise band depends on the number of users and on the variance of the metric.</li></ul><h3>What’s next?</h3><p>We ended this part with a problem: a real +5% GMV effect can be hidden inside the noise, even with 100,000 users. In the next part, we will try to solve it:</p><ul><li><strong>Sample size</strong>: How many users do we need to see an effect of a given size?</li><li><strong>Peeking: </strong>Why can’t we just check the results every day and stop when they look good?</li><li><strong>Variance reduction:</strong> How can we use the users’ past data to measure the same effect with fewer users?</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=86b3cbc09aa1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[End-User-Authentication with Istio & Keycloak]]></title>
            <link>https://medium.com/@engin.gungor14/end-user-authentication-with-istio-keycloak-b7f10965b691?source=rss-c16c20998f73------2</link>
            <guid isPermaLink="false">https://medium.com/p/b7f10965b691</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Engin Güngör]]></dc:creator>
            <pubDate>Sun, 19 Dec 2021 18:53:32 GMT</pubDate>
            <atom:updated>2021-12-22T21:02:34.417Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LIQdkxR6kHsd7ahY7-sVfw.png" /><figcaption>Final Flow of Microservice</figcaption></figure><p>Managing AuthN &amp; AuthZ is one of the challenging topics.However, With Cloud Native approach could be handle this kind of issue with tools. Those tools also improves security of App. Today, we are deploy basic application and we would secure it with Istio. Let’s start.</p><h3>Keycloak Deployment &amp; Configuration</h3><p>Firstly we will configure auth provider. Keycloak is open source identity and access management solution.</p><p>You could deploy Keycloak with the following YAML file for development purposes. <strong>(Not highly available). </strong>I<strong> </strong>also configured YAML for specific namespace property for deployment and I exposed the service as a <strong>NodePort</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c1e6b4cd15b7ae06eeec259587f4a19/href">https://medium.com/media/8c1e6b4cd15b7ae06eeec259587f4a19/href</a></iframe><p>Also, you could configure YAML for your environment. Let&#39;s reach the Keycloak <strong>Administration Console </strong>and configure it according to your needs. Credentials are defined in the YAML file as an “admin:admin”.</p><pre>http://&lt;MASTER_IP&gt;:30034</pre><p>Firstly let’s create a new realm. Definition of realm by Keycloak is:</p><blockquote>A realm manages a set of users, credentials, roles, and groups. A user belongs to and logs into a realm. Realms are isolated from one another and can only manage and authenticate the users that they control.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/482/1*0wSI2Q8eGSo1oTk7PqkE6w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*6shCwgegNub1JjNeG08NQg.png" /></figure><p>After creation of realm we should create client. Client definition according to Keycloak;</p><blockquote>Clients are entities that can request Keycloak to authenticate a user. Most often, clients are applications and services that want to use Keycloak to secure themselves and provide a single sign-on solution. Clients can also be entities that just want to request identity information or an access token so that they can securely invoke other services on the network that are secured by Keycloak.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JRddJxU7ZlMF3ncfZWjFCw.png" /><figcaption>User Auth Flow</figcaption></figure><p>Let’s configure the client. However, we would only create we don’t have to configure client because we won’t create frontend service and doesn’t implement Oauth2 flow to the application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*T4AxzK_8HE89s1Xz6_2c5w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ICYGndIVfUWS_VWhVmSUSA.png" /><figcaption>Create a client</figcaption></figure><p>Let’s create example user for our realm. User can be created from Manage -&gt; User menu.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uca637cn1plNSz_LwZe43Q.png" /><figcaption>Create User</figcaption></figure><p>Create a user as enabled. After creation, we should set credentials for the user. You can reach the credentials tab from the user detail page. <strong>Password must not be Temporary.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cqI-5CyHRFqfDKPe7QO-qg.png" /></figure><p>I create a user with “test:test” credential you could get a user token with the following command if you have followed the tutorial. We will be reach with id-token to our app.</p><pre>curl -X POST <a href="http://23.88.62.179:30034/auth/realms/kc-sample/protocol/openid-connect/token">http://&lt;MASTER-IP&gt;:30034/auth/realms/kc-sample/protocol/openid-connect/token</a> -d grant_type=password -d client_id=kc-sample-client -d username=test -d password=test -d scope=openid -d response_type=id_token|jq .id_token</pre><p>Let’s move on to the Istio part.</p><h3>Istio &amp; Deployment</h3><p>For this tutorial, I created a basic service with Go. You could reach the source code of the app from my GitHub account.</p><p>I won’t explain Deployment and Service YAML. We move on to configuring Istio. Let’s begin with basic deployment.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/57d317e411bda36efc2d42ac05ccc7f6/href">https://medium.com/media/57d317e411bda36efc2d42ac05ccc7f6/href</a></iframe><p>The important part you should enable Istio in the application <strong>namespace.</strong> To achieve this you should add an <strong>istio-injection: true </strong>label to your namespace. Istio will inject Envoy proxy as a sidecar to all workload in the given namespace.</p><p>After that let’s create a gateway.</p><blockquote>Gate describes a load balancer operating at the edge of the mesh receiving incoming or outgoing HTTP/TCP connections. The specification describes a set of ports that should be exposed, the type of protocol to use, SNI configuration for the load balancer, etc.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1daa4b53b7bebcfc06b134b145aa719e/href">https://medium.com/media/1daa4b53b7bebcfc06b134b145aa719e/href</a></iframe><p>Another important part is creating a virtual service for our microservice. Virtual service.</p><blockquote>A VirtualService defines a set of traffic routing rules to apply when a host is addressed. Each routing rule defines matching criteria for traffic of a specific protocol. If the traffic is matched, then it is sent to a named destination service (or subset/version of it) defined in the registry.</blockquote><p>In our example, we will use a Virtual service to connect the istio-ingress gateway to our microservice. However, it could be used for other operations like Traffic splitting, mirroring, etc.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8ff397587f0cd4b1b62712f4f1b4f69f/href">https://medium.com/media/8ff397587f0cd4b1b62712f4f1b4f69f/href</a></iframe><p>With the following virtual service deployment, we could reach from application <a href="http://istio-ingress-gateway-adress/user">http://istio-ingress-gateway-adress/user</a> for my implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n9HIyRD4hAIzfDmYx_Si2w.png" /></figure><pre>http://&lt;MASTER-IP&gt;:31384/user</pre><p>We came to the final part. We have to implement end-user auth with <strong>RequestAuthentication</strong> and <strong>AuthorizationPolicy</strong>. <strong>We won’t define any Authorization Policy in Part 1.</strong></p><p>In the RequestAuthentication resource, we should select our microservice with a selector. It is not a different approach in the K8s world. Also, we should define JWT rules. The issuer identifies the issuer that issued the JWT. It should be the address of our realm. JwksUri (JSON Web Key Set Uri) is public keys to validate the signature of the JWT. OutputPayloadToHeader is another important part of the implementation that specifies the header name to output a successfully verified JWT payload to the backend <strong>Base64 encoded</strong>. The header name will be “<strong>jwt-parsed</strong>” in this example.</p><p>Our sample-user service will be reachable from all users. We won’t define specific authorization rules in this example.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0dc270bb41d85111d2c7f826bc538132/href">https://medium.com/media/0dc270bb41d85111d2c7f826bc538132/href</a></iframe><p>Now we are ready to test our implementation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LIQdkxR6kHsd7ahY7-sVfw.png" /><figcaption>Final Flow of Microservice</figcaption></figure><h3>Test!</h3><ol><li>Get id token first which is already given before.</li></ol><pre>curl -X POST <a href="http://23.88.62.179:30034/auth/realms/kc-sample/protocol/openid-connect/token">http://&lt;MASTER-IP&gt;:30034/auth/realms/kc-sample/protocol/openid-connect/token</a> -d grant_type=password -d client_id=kc-sample-client -d username=test -d password=test -d scope=openid -d response_type=id_token|jq .id_token</pre><p>2. Send GET request with Authentication header.</p><pre>curl -H &quot;Authorization: Bearer $TOKEN&quot; <a href="http://23.88.62.179:31384/user">http://&lt;istio-ingress&gt;/user</a></pre><p>3. Service return username of logged user.</p><pre>Username: test</pre><p>Congratulations, your service is secured with help of Istio and Keycloak.</p><p>You can reach project from my <a href="https://github.com/esgungor/istio-auth-sample">repository.</a> Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b7f10965b691" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>