<?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 sirisha on Medium]]></title>
        <description><![CDATA[Stories by sirisha on Medium]]></description>
        <link>https://medium.com/@siriprak?source=rss-36be4146e672------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ZCn-tBLVlVEaYm8Z.jpeg</url>
            <title>Stories by sirisha on Medium</title>
            <link>https://medium.com/@siriprak?source=rss-36be4146e672------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 03:08:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@siriprak/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 SSO works?]]></title>
            <link>https://medium.com/@siriprak/how-sso-works-d042332a4409?source=rss-36be4146e672------2</link>
            <guid isPermaLink="false">https://medium.com/p/d042332a4409</guid>
            <category><![CDATA[howstuffworks]]></category>
            <category><![CDATA[sso]]></category>
            <dc:creator><![CDATA[sirisha]]></dc:creator>
            <pubDate>Sun, 19 Apr 2020 19:46:28 GMT</pubDate>
            <atom:updated>2020-04-19T19:46:28.702Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What is Single Sign-On</strong></p><p>SSO is primarily an authentication mechanism. It uses popular services like Google, Facebook where most users have accounts for verifying user’s identity.</p><p><strong><em>Analogy</em></strong></p><p>Suppose you go to a bar and order a drink and to serve you a drink the bartender has to know if you are above 21. The bartender simply asks for your identity card(say driving license) to check this information. In this case the driving license provided by DMV is vouching if you are above 21. SSO is very similar to your identity card(driving license). The DMV who vouches for you is called Identity provider(Google, Facebook) and can give access to the drink (Web application).</p><h3><strong>SSO Framework</strong></h3><p>The general working of SSO is captured by the below diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*x-XmRRB6qZ-CKngQrHZFHw.png" /></figure><p>When the user is authenticated with the Identity provider(IdP), it send a unique token which is used by the webserver to identify the user. The actual details of the token varies depending on the SSO implementation used.</p><p><strong>The Confusion</strong></p><p>In a real-world scenario, most SSO implementations provide both authentication and authorization.</p><p><a href="https://openid.net/what-is-openid/">OpenID</a> is an authentication framework developed by OpenID foundation. (now obsolete)</p><p><a href="https://tools.ietf.org/html/rfc7522">SAML 2.0</a> framework supports both authentication and authorization.</p><p>OAuth2.0 is an authorization framework. This mechanism is used by companies such as Amazon, Google, Facebook, Microsoft and Twitter to permit the users to share information about their accounts with third party applications or websites.</p><p><a href="https://openid.net/connect/">OpenID Connect</a> is an authentication layer on top of OAuth 2.0 authorization framework.</p><h3><strong>OAuth2.0</strong></h3><p>To understand the OpenIDC framework, we first have to understand the OAuth2.0 framework. OAuth is a authorization framework which is used to share resources to thirdparty clients.</p><p><strong><em>OAuth defines 4 roles:</em></strong></p><ul><li>Resource owner aka user</li><li>Resource provider — server which hosts the resource</li><li>Client — Thirdparty who requests the resource</li><li>Authorization server — The server that issues access token to the client after authenticating the resource owner and obtaining authorization.</li></ul><p>Protocol Flow diagram taken from the RFC:</p><pre>     +--------+                               +---------------+<br>     |        |--(A)- Authorization Request -&gt;|   Resource    |<br>     |        |                               |     Owner     |<br>     |        |&lt;-(B)-- Authorization Grant ---|               |<br>     |        |                               +---------------+<br>     |        |<br>     |        |                               +---------------+<br>     |        |--(C)-- Authorization Grant --&gt;| Authorization |<br>     | Client |                               |     Server    |<br>     |        |&lt;-(D)----- Access Token -------|               |<br>     |        |                               +---------------+<br>     |        |<br>     |        |                               +---------------+<br>     |        |--(E)----- Access Token ------&gt;|    Resource   |<br>     |        |                               |     Server    |<br>     |        |&lt;-(F)--- Protected Resource ---|               |<br>     +--------+                               +---------------+</pre><p>The popular authorization grants are implicit grant and authorization code.</p><p>In authorization code flow, the client redirects the resource owner to Identity provider to authenticate, the IdP passes a shorted lived authorization code. The client uses this code to obtain an access token.</p><p>In implicit flow, the client redirects the resource owner to IdP to authenticate and the Idp returns the access token to the client via resource owner(user).</p><p><strong><em>OAuth 2.0 Scopes:</em></strong></p><p>Scope is a mechanism in OAuth 2.0 to limit an application’s access to a user’s account. An application can request one or more scopes, this information is then presented to the user in the consent screen, and the access token issued to the application will be limited to the scopes granted.</p><p><strong><em>Bearer token:</em></strong></p><p>Bearer Tokens are the predominant type of access token used with OAuth 2.0.</p><p>A Bearer Token is an opaque string, not intended to have any meaning to clients using it. Some servers will issue tokens that are a short string of hexadecimal characters, while others may use structured tokens such as JSON Web Tokens.</p><p><strong><em>Authentication using ID Token:</em></strong></p><p>The primary extension that OpenID Connect makes to OAuth 2.0 to enable End-Users to be Authenticated is the ID Token data structure. The ID Token is a security token that contains Claims about the Authentication of an End-User by an Authorization Server when using a Client, and potentially other requested Claims. The ID Token is represented as a JSON Web Token (JWT).</p><h3><strong>SAML 2.0</strong></h3><p>SAML is an XML-based markup language for security assertions. SAML assertion consists of many statements. Some of the important ones are:</p><ul><li>Issuer — Identity provider</li><li>Subject — Client</li><li>Condition — Timestamps</li><li>Authentication Statement</li><li>Attribute Value — Can be used to give information about the authenticated user. Can be used as authorization context(?)</li></ul><p>The basic flow of SSO remains the same for SAML 2.0. Instead of Bearer token (used in OpenIDC), SAML assertions are used for authorization and authentication.</p><p>In the next blog post, we will learn about SSO implemented in platforms like Google, Facebook, Okta with some real examples.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d042332a4409" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>