<?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 Sincy Sebastian on Medium]]></title>
        <description><![CDATA[Stories by Sincy Sebastian on Medium]]></description>
        <link>https://medium.com/@sincysebastian?source=rss-292a9831f4d5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*MDUHGzoOj4EuevGO.</url>
            <title>Stories by Sincy Sebastian on Medium</title>
            <link>https://medium.com/@sincysebastian?source=rss-292a9831f4d5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 20:22:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sincysebastian/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[Federated Identity Concepts]]></title>
            <link>https://medium.com/@sincysebastian/federated-identity-concepts-462f4d31e84d?source=rss-292a9831f4d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/462f4d31e84d</guid>
            <dc:creator><![CDATA[Sincy Sebastian]]></dc:creator>
            <pubDate>Sat, 22 Apr 2023 15:59:13 GMT</pubDate>
            <atom:updated>2023-04-22T15:59:13.997Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Single Sign On and Identity federation Concepts</strong></h3><p>Most enterprise applications used to be developed in-house and deployed locally. At that time security was fairly easy to manage. Username and password authentication was the most common method used, where the passwords were hashed and stored in the database. However today there are many types of authentication mechanisms such as Social authentication (login via social network), Password less authentication (OTP based), Multi-factor Authentication (login using username/password and second level using OTP or some password generator), Fingerprint, Face recognition etc.</p><p>SSO (single sign on) came when organizations needed to centralize the authentication system for different apps and services. For e.g. in an organization there will be multiple applications. Rather than creating separate credentials for employees in each system, they can now access all the apps after a single login. Another example is when you login to Google, the user is automatically authenticated to YouTube, Gmail and AdSense etc.</p><p>A new challenge in API based application ecosystems is when third party apps need to access a system’s API. There should a provision where users can provide specific permissions to third-party app for selected resources and data. Also, now a days there is lot of SaaS (software as a service) products like HR system, payroll system, referral system which provides specific services. Many enterprises have adopted these kind of specialized products instead of building monolithic applications by themselves. Below is an overview of newer mechanisms and standards such as Federated Identity which has evolved to solve the new challenges in the area of Identity and Access Management.</p><p><strong>Federated Identity</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*QfpYbLqO-yqCoL6eOXo-bA.png" /></figure><p>It is a system which allows multiple enterprises to use the same identification data to obtain access to all the enterprises in the same group. When two domains are federated the user can access one domain if the user is authenticated in the other domain. Identity federation involves individual user level access, user to an application, application to application in browser or in SOA environments. Currently the major protocols for implementing federated Identity are: <strong>SAML</strong>, <strong>OAuth2 </strong>&amp; <strong>Open ID Connect.</strong></p><p>To recap on authentication and Authorization<strong>,</strong> <strong>Authentication </strong>is validating the login credentials before giving the user access to the system whereas <strong>Authorization </strong>is granting access to the required resources after authentication.</p><p>Before we go to identity protocols, let us see what is an Identity provider and service provider.</p><p><strong>Identity Provider</strong>: Responsible for actually storing and managing user identities. Below are few ways to manage identity.</p><ul><li>Database/Local: Manage the user through local database username/password and the roles assigned.</li><li>Microsoft — Active Directory (AD), Azure AD.</li><li>AWS: Amazon Cognito.</li><li>Social providers: Google, Facebook etc. typically uses OAuth protocol.</li><li>Others: Products like Auth0, Okta which is specialized in Identity Management with Additional features.</li></ul><p><strong>Service Provider (SP): </strong>The client application.</p><p><strong>Resource Server:</strong> The Server hosting protected resources like micro services etc (for example Facebook hosting your profile and personal information)</p><p>Now let us see the different protocols used for managing federated identity.</p><p><strong>SAML (Security Assertion markup language): </strong>SAML is an XML-based standard for exchanging authentication and authorization data between an identity provider (IDP) and a service provider (SP). Service provider agrees to trust the IDP to authenticate the users. And IDP generates the authentication assertion.</p><p>The users will be configured in the IDP which enables SSO. Also it allows to configure the authorization easily. Authentication information is shared through digitally signed certificates. The flow can be initiated either from Service provider or from Identity provider</p><p><strong>SP-initiated flow: </strong>User attempts to sign to the application (SP) which has SAML enabled. The user will be redirected to the IDP page which will redirect the user to IDP’s login page. If the user’s credentials are correct then IDP will grant access and then redirect the user back to SP.</p><p><strong>IDP-initiated flow</strong>: User access SP from the IDP page. From IDP page user clicks on the SP.</p><p>Below diagram illustrates the SAML flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*DEuR8yZhdXg3zlM8uhWY2w.png" /></figure><p>Below are the steps involved.</p><ol><li>Browser access the application (SP), the SP generates the SAML request and create redirect</li><li>Browser redirect to the IDP with SAML request</li><li>IDP parses the SAML request, authenticates the user (via username and password or any other methods. If the user is already authenticated in the same browser by earlier logins, this step will be skipped) and generates a SAML response.</li><li>IDP generates SAML response. It contains user information, roles and then redirects (browser and then to SP) to SP.</li></ol><p><strong>OpenId Connect / OAuth 2.0: </strong>This is another important protocol to implement Federated Identity. OAuth is designed for authorization for an action on a resource. OpenId is added for authentication which sits on top of OAuth2.Below is the flow diagram of OAuth2.0.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/886/1*Mvi1H1nDdgrRYjq86aRQgA.png" /><figcaption>Ref: <a href="https://speakerdeck.com/nbarbettini/oauth-and-openid-connect-in-plain-english">https://speakerdeck.com/nbarbettini/oauth-and-openid-connect-in-plain-english</a></figcaption></figure><p>And below are the steps involved.</p><ol><li>User access the client application, and the client page shows login via google/Facebook button.</li><li>Once the user click on the button, user will be redirected google/Facebook login page.</li><li>After the user logs in, the authenticating application (google/Facebook) asks for user permission whether to grant access to user’s specific data to the client application.</li><li>Once the user accepts, the authenticating application (google/Facebook) redirects the user to the client URI which is provided by the client application along with authorization code.</li><li>Now the client application will request for access token to the authorization system by exchanging the authorization code.</li><li>Access token allows to do specific actions on specific resources which is controlled by Scope. Authorization server will have specific scope for each action and resource. When the client asks for a given scope in the initial request, the authorization server asks the user’s consent after login and the generated access token will be scoped for the corresponding actions. Note: All the URLs request parameters are visible including the redirect URI with the authorization code. But the access token is requested by the client-application’s server code (using the authorization code + secret key which is stored in the server side) and not by the browser code so that access token can’t be stolen.</li><li>And after that for the resource api call, the request is invoked from the server code with the access token instead from the client code.But when the client application is purely a frond end application without any server code this way will not be possible. We have to use the implicit flow and need to take care of the security aspects like someone else using the tokens.</li></ol><p><strong>OpenId Connect</strong> is added on top of OAuth 2.0 for authentication. It is not a separate protocol. It is sitting on top of OAuth2. Apart from the access token in OAuth 2.0, OpenId connect gives an Id token also which has user information. The id token is called JSON Web token or JWT token. JWT is an open standard that describes a way to transmit the claims between two parties in a secured way. This contains header, payload, Signature. And signature is used to validate whether the token is altered using HMAC.</p><p>For getting the Id token, in the initial IDP request client needs to request for an additional scope(openId ).So the “id token” will have some user information and for any resource requests access token will be used since that is the authorization part.</p><p>So OpenId Connect &amp; OAuth 2.0(Authentication and Authorization) flow will be as in the below picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/997/1*sIA9ckISe0yW0jj2g3PXWA.png" /><figcaption>Ref:<a href="https://speakerdeck.com/nbarbettini/oauth-and-openid-connect-in-plain-english">https://speakerdeck.com/nbarbettini/oauth-and-openid-connect-in-plain-english</a></figcaption></figure><p>Apart from the above two protocols, there is WS-Federation which is very similar to SAML. Another one is LDAP (lightweight directory access protocol) which is mostly paired with Active Directory which allows to have a central location for user’s identity. It is commonly used in company intranet services for employees.</p><h4>Single Sign On</h4><p>In SSO when user logs in to one system the user is automatically granted access to services in different systems. Using SAML or OAuth protocols we saw how to authenticate the user in one domain. In SSO if the user is logged in to one domain the user shouldn’t be asked to login again when the user access other domains. The browser same origin policy (CORS) prevents the access to cookies set in domain 1 by domain 2. Hence there needs to be a central domain for which the user will be redirected always when ever the user access any domain. In this central domain the authentication information will be stored in the cookie which allows to use the cookie from multiple domains and allows SSO.</p><p>Below diagram illustrates the SSO flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yQKeOl27bK9_uYB5q-hzqw.png" /><figcaption>Ref:<a href="https://cdn.auth0.com/blog/sso/typical-sso-v2.png">https://cdn.auth0.com/blog/sso/typical-sso-v2.png</a></figcaption></figure><p>User access domain 1 and will be redirected to domain 3 which is the centralized authentication server. And after authentication the cookie will be stored in the browser for domain 3.</p><p>When the user access domain 2, browser will be redirected to the centralized authentication server (domain 3) and since the domain 3 cookies are available the user will be authenticated with out logging in again.</p><p><strong>Conclusion</strong></p><p>Federated Identity Management helps to create, edit, and delete the users easily. If the employee leaves the organization this allows to delete the user so that the employee will be deactivated to all the system in the federation. It simplifies the process of authenticating and authorizing the users in the same federation. Administrators can set permissions and access level to different users in different applications. Allows to configure third-party applications to use the resources. In user point of view user can access all the systems with single login. Different SaaS products can be brought together in an enterprise application.</p><p><strong>References</strong></p><p><a href="https://auth0.com/resources/whitepapers/definitive-guide-to-single-sign-on">https://auth0.com/resources/whitepapers/definitive-guide-to-single-sign-on</a></p><p><a href="https://support.okta.com/help/s/article/Beginner-s-Guide-to-SAML">https://support.okta.com/help/s/article/Beginner-s-Guide-to-SAML</a></p><p><a href="https://www.okta.com/integrate/documentation/saml/">https://www.okta.com/integrate/documentation/saml/</a></p><p><a href="https://auth0.com/blog/how-saml-authentication-works/">https://auth0.com/blog/how-saml-authentication-works/</a></p><p><a href="https://www.youtube.com/watch?v=996OiexHze0">https://www.youtube.com/watch?v=996OiexHze0</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=462f4d31e84d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setup Kafka with Debezium using Strimzi in Kubernetes]]></title>
            <link>https://medium.com/@sincysebastian/setup-kafka-with-debezium-using-strimzi-in-kubernetes-efd494642585?source=rss-292a9831f4d5------2</link>
            <guid isPermaLink="false">https://medium.com/p/efd494642585</guid>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[debezium]]></category>
            <category><![CDATA[kafka]]></category>
            <category><![CDATA[kafka-connect]]></category>
            <category><![CDATA[strimzi]]></category>
            <dc:creator><![CDATA[Sincy Sebastian]]></dc:creator>
            <pubDate>Thu, 30 May 2019 17:13:18 GMT</pubDate>
            <atom:updated>2019-05-30T17:13:18.209Z</atom:updated>
            <content:encoded><![CDATA[<p><a href="https://kubernetes.io/">Kubernetes</a> automates the distribution and scheduling of application containers across a cluster in an efficient way. <a href="https://strimzi.io/">Strimzi </a>gives an easy way to run Apache Kafka on <a href="https://kubernetes.io/">Kubernetes </a>or Openshift and <a href="https://debezium.io/">Debezium</a> provides custom Kafka connectors.</p><p>This blog will demonstrate the steps to deploy Debezium in Kubernetes using Strimzi. We will be using the example from Debezium (https://github.com/debezium/debezium-examples/tree/master/unwrap-smt). The scenario we are going to use is to receive events from MySQL database(source) using Debezium connector and save them in Elastic search(sink), <strong>using Strimzi in Kubernetes development or test environment.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*70hh8h-0zRpxqeFwA5zJSw.png" /><figcaption>Flow Diagram</figcaption></figure><p>Prerequisites:</p><ul><li>Kubernetes basic knowledge(<a href="https://kubernetes.io/docs/tutorials/kubernetes-basics/">https://kubernetes.io/docs/tutorials/kubernetes-basics/</a>).</li><li>Kubernetes cluster or Minikube</li></ul><p>Note: Replace the text styled in italics with your corresponding values.</p><p><strong>Step1: Strimzi artifacts</strong></p><p>Download the artifacts from strimzi repository ( <a href="https://github.com/strimzi/strimzi-kafka-operator/releases">https://github.com/strimzi/strimzi-kafka-operator/releases</a>) and extract the folder — strimzi-0.11.4.zip.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/234/1*XFq_IIhJCOAp05JxKKAzrg.png" /></figure><p><strong>Step2: Deploy Strimzi Cluster operator</strong></p><p>1)Replace the files with the your namespace: I used default.</p><pre>sed -i ‘s/namespace: .*/namespace: default/’ install/cluster-operator/*RoleBinding*.yaml</pre><p>2)And apply the operator</p><pre>kubectl apply -f install/cluster-operator</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/1*sLPQsHitft86Ma3bS8XvZw.png" /></figure><p><strong>Step3: Deploy Kafka cluster operator</strong></p><p>This will deploys Kafka and Zookeeper with necessary configurations.We will be deploying a non-persistent cluster which is for development and testing and <strong>not for production.</strong></p><pre>kubectl apply -f examples/kafka/kafka-ephemeral.yaml</pre><p>And check the pods and services using kubectl command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RW_3UORBNlQ7Iq6c45pvSQ.png" /></figure><p><strong>Step4: Test the Kafka set up</strong></p><p>Producer : Use the producer utility in the Kafka pod , and send message to the bootstrap service <em>(here it is my-cluster-kafka-bootstrap)</em> using the below command<em> </em>and enter messages.</p><pre>kubectl exec -i <strong><em>my-cluster-kafka-0</em></strong> -- bin/kafka-console-producer.sh --broker-list <strong><em>my-cluster-kafka-bootstrap</em></strong>:9092 --topic <strong><em>strimizi-my-topic</em></strong></pre><p>Consumer: Use the consumer in the Kafka pod to receive messages. In another terminal execute the below command and see the messages</p><pre>kubectl exec -i <strong><em>my-cluster-kafka-0</em></strong> -- bin/kafka-console-consumer.sh --bootstrap-server <strong><em>my-cluster-kafka-bootstrap</em></strong>:9092 --topic <strong><em>strimizi-my-topic</em></strong> --from-beginning</pre><p>To find out the topics in the Kafka cluster use the below command.(Zookeeper is accessible through localhost:2181 and my-cluster-zookeeper-client is not accessible) from outside.</p><pre>kubectl exec <strong>my-cluster-kafka-0</strong>   -- bin/kafka-topics.sh --list --zookeeper localhost:2181</pre><p><strong>Step5: Deploy Kafka Connect with custom connectors</strong></p><p>5.1) Add the required connectors to Strimzi Kafka connect image.In our case, add Debezium MySQL connector and confluent Elastic search connector to Strimzi Kafka Connect image.</p><ul><li>Create a DockerFile with the below content and save it .</li></ul><pre>FROM strimzi/kafka-connect:0.11.4-kafka-2.1.0<br>USER root:root<br>COPY ./my-plugins/ /opt/kafka/plugins/<br>USER 1001</pre><ul><li>Download and extract the MySQL connector plugin from <a href="http://central.maven.org/maven2/io/debezium/debezium-connector-mysql/">http://central.maven.org/maven2/io/debezium/debezium-connector-mysql/</a></li><li>Download and extract the ElasticSearch connector from<br><a href="https://docs.confluent.io/current/connect/kafka-connect-elasticsearch/index.html">https://docs.confluent.io/current/connect/kafka-connect-elasticsearch/index.html</a></li></ul><p>And place the connector plugins in your local machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*leq9hUOGsVHgeh0h0H7hUw.png" /><figcaption>Folder structure</figcaption></figure><p>5.2)Build the docker file</p><pre>docker build -t deb_connectors .</pre><pre>docker images</pre><p>Inspect the docker image plugin directory and check the added connector plugins:</p><pre>docker run -it deb_connectors sh</pre><p>5.3)Tag and Push to Docker hub</p><p>Create an account in <a href="https://hub.docker.com/">Docker Hub </a>if you don’t have. Now in command line execute the below commands to log in and push the new image.</p><pre>docker login<br>docker images</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*74xxEuBtlYE0USPq1EKc-g.png" /></figure><p>Tag and Push the image</p><pre>docker tag image <em>yourusername</em>/repository:tag</pre><pre>docker tag f38eef0fb770 <em>yourusername</em>/deb_connectors:part1</pre><pre>docker push <em>yourusername</em>/deb_connectors:part1</pre><p>Refer the <a href="https://docs.docker.com/get-started/part2/">docker tutorials</a> for more details on build and push.</p><p>5.2)Modify and Deploy KafkaConnect in the cluster</p><p>Take the yaml file from Strimzi example folder (examples/kafka-connect/kafka-connect.yaml) and add your new image .</p><pre>apiVersion: kafka.strimzi.io/v1alpha1<br>kind: KafkaConnect<br>metadata:<br>  name: my-connect-cluster<br>spec:<br>  ---------<br>  bootstrapServers: my-cluster-kafka-bootstrap:9093<br>  <strong>image: <em>yourusername/deb_connectors:part1</em></strong><br><br>  tls:<br>    trustedCertificates:<br>      --------</pre><p>and apply</p><pre>kubectl apply -f examples/kafka-connect/kafka-connect.yaml</pre><p>Check the Pods and Services</p><pre>kubectl get svc<br>kubectl get pods<br>kubectl describe pod <strong><em>connectorPodName </em></strong>(validate your new image used by the connector POD)</pre><p>Execute the below command to list the available connector plugins</p><pre>kubectl exec -i <strong><em>my-cluster-kafka-0</em></strong> -- curl -X GET http://<strong>my-connect-cluster-connect-api</strong>:8083/connector-plugins</pre><p><strong>Step 6: Create a MySQL test DB and expose as a service</strong></p><pre>kubectl create -f <a href="https://raw.githubusercontent.com/sincysebastian1/Kubernetes/master/DebeziumConnectors/mysql.yaml">https://raw.githubusercontent.com/sincysebastian1/Kubernetes/master/DebeziumConnectors/mysql.yaml</a></pre><pre>kubectl expose deployment mysql --port=3306 --target-port=3306</pre><p><strong>Step7: Start the Connectors</strong></p><p>Take file source.json from the Debezium repository</p><p><a href="https://raw.githubusercontent.com/debezium/debezium-examples/master/unwrap-smt/source.json">https://raw.githubusercontent.com/debezium/debezium-examples/master/unwrap-smt/source.json</a></p><p>and <strong>modify the field value database.history.kafka.bootstrap.servers</strong>.</p><pre>In my case it is &quot;database.history.kafka.bootstrap.servers&quot;: &quot;my-cluster-kafka-bootstrap:9092&quot;</pre><p>Take es-sink.json from <a href="https://github.com/debezium/debezium-examples/blob/master/unwrap-smt/es-sink.json">https://github.com/debezium/debezium-examples/blob/master/unwrap-smt/es-sink.json</a> and modify the elastic search end point with yours.</p><p>Now execute the below commands</p><pre>cat <strong><em>source.json</em></strong> | kubectl exec -i <strong><em>my-cluster-kafka-0</em></strong> -- curl -X POST -H &quot;Accept:application/json&quot; -H &quot;Content-Type:application/json&quot; <a href="http://my-connect-cluster-connect-api:8083/connectors">http://<strong><em>my-connect-cluster-connect-api</em></strong>:8083/connectors</a> -d @-</pre><pre>cat <strong><em>es-sink.json</em></strong> | kubectl exec -i <strong><em>my-cluster-kafka-0</em></strong> -- curl -X POST -H &quot;Accept:application/json&quot; -H &quot;Content-Type:application/json&quot; <a href="http://my-connect-cluster-connect-api:8083/connectors">http:/<strong><em>/my-connect-cluster-connect-api</em></strong>:8083/connectors</a> -d @-</pre><ul><li>View the connectors</li></ul><pre>kubectl exec -i my-cluster-kafka-0 -- curl -X GET <a href="http://my-connect-cluster-connect-api:8083/connectors">http://my-connect-cluster-connect-api:8083/connectors</a></pre><ul><li>View all the topics</li></ul><pre>kubectl exec my-cluster-kafka-0   -- bin/kafka-topics.sh --list --zookeeper localhost:2181</pre><ul><li>View the messages from mysql connector in Kafka the topic “customers”</li></ul><pre>kubectl exec -i <strong><em>my-cluster-kafka-0</em></strong> -- bin/kafka-console-consumer.sh --bootstrap-server <strong><em>my-cluster-kafka-bootstrap</em></strong>:9092 --topic <strong><em>customers </em></strong>--from-beginning</pre><ul><li>View the records in Elastic Search</li></ul><pre>curl &#39;http:// http://your_elasticsearch_endpoint:9200/customers/_search?pretty&#39;</pre><p><strong>Step8: Modify MySQL records and validate in Elastic search</strong></p><ul><li>Login to MySQL terminal and run</li></ul><pre>kubectl exec -it mysql-5fc9f7d58-hvf9g  -- bash -c &#39;mysql -u $MYSQL_USER -p$MYSQL_PASSWORD inventory&#39;</pre><pre>insert into customers values(default, &#39;hello&#39;, &#39;strimzi&#39;, &#39;<a href="/service/mailto:hello@example.com">hello@example.com</a>&#39;);</pre><ul><li>And see the changes are reflected in Elastic search</li></ul><pre>curl &#39;http:// http://your_elasticsearch_endpoint:9200/customers/_search?pretty&#39;</pre><h3>References</h3><ul><li><a href="https://strimzi.io/">Strimzi - Apache Kafka on Kubernetes</a></li><li><a href="https://debezium.io/">Debezium</a></li><li><a href="https://github.com/debezium/debezium-examples/tree/master/unwrap-smt">debezium/debezium-examples</a></li><li><a href="https://kubernetes.io/">Production-Grade Container Orchestration</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efd494642585" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>