<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://logicwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=OAUTH_2.0_Flows_With_Diagrams</id>
		<title>OAUTH 2.0 Flows With Diagrams - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://logicwiki.co.uk/index.php?action=history&amp;feed=atom&amp;title=OAUTH_2.0_Flows_With_Diagrams"/>
		<link rel="alternate" type="text/html" href="http://logicwiki.co.uk/index.php?title=OAUTH_2.0_Flows_With_Diagrams&amp;action=history"/>
		<updated>2026-04-22T06:13:03Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://logicwiki.co.uk/index.php?title=OAUTH_2.0_Flows_With_Diagrams&amp;diff=2108&amp;oldid=prev</id>
		<title>AliIybar at 10:55, 11 February 2021</title>
		<link rel="alternate" type="text/html" href="http://logicwiki.co.uk/index.php?title=OAUTH_2.0_Flows_With_Diagrams&amp;diff=2108&amp;oldid=prev"/>
				<updated>2021-02-11T10:55:25Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 10:55, 11 February 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot; &gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Security]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Security]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[Click here to watch flows as videos https://www.youtube.com/playlist?list=PLxDcFnLrbxvZXWSb8zRf9-EwG7N5lrmAE]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Authorization Code Flow ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Authorization Code Flow ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A client application (a) makes an authorization request to an authorization endpoint, (b) receives a short-lived authorization code, (c) makes a token request to a token endpoint with the authorization code, and (d) gets an access token.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;A client application (a) makes an authorization request to an authorization endpoint, (b) receives a short-lived authorization code, (c) makes a token request to a token endpoint with the authorization code, and (d) gets an access token.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AliIybar</name></author>	</entry>

	<entry>
		<id>http://logicwiki.co.uk/index.php?title=OAUTH_2.0_Flows_With_Diagrams&amp;diff=2107&amp;oldid=prev</id>
		<title>AliIybar: Created page with &quot;Category:Oauth Category:Security  == Authorization Code Flow == A client application (a) makes an authorization request to an authorization endpoint, (b) receives a sh...&quot;</title>
		<link rel="alternate" type="text/html" href="http://logicwiki.co.uk/index.php?title=OAUTH_2.0_Flows_With_Diagrams&amp;diff=2107&amp;oldid=prev"/>
				<updated>2021-02-11T10:44:35Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/index.php?title=Category:Oauth&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Category:Oauth (page does not exist)&quot;&gt;Category:Oauth&lt;/a&gt; &lt;a href=&quot;/Category:Security&quot; title=&quot;Category:Security&quot;&gt;Category:Security&lt;/a&gt;  == Authorization Code Flow == A client application (a) makes an authorization request to an authorization endpoint, (b) receives a sh...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Oauth]]&lt;br /&gt;
[[Category:Security]]&lt;br /&gt;
&lt;br /&gt;
== Authorization Code Flow ==&lt;br /&gt;
A client application (a) makes an authorization request to an authorization endpoint, (b) receives a short-lived authorization code, (c) makes a token request to a token endpoint with the authorization code, and (d) gets an access token.&lt;br /&gt;
&lt;br /&gt;
[[File:Oauth1.png]]&lt;br /&gt;
=== Request To Authorization Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET {Authorization Endpoint}&lt;br /&gt;
  ?response_type=code             // - Required&lt;br /&gt;
  &amp;amp;client_id={Client ID}          // - Required&lt;br /&gt;
  &amp;amp;redirect_uri={Redirect URI}    // - Conditionally required&lt;br /&gt;
  &amp;amp;scope={Scopes}                 // - Optional&lt;br /&gt;
  &amp;amp;state={Arbitrary String}       // - Recommended&lt;br /&gt;
  &amp;amp;code_challenge={Challenge}     // - Optional&lt;br /&gt;
  &amp;amp;code_challenge_method={Method} // - Optional&lt;br /&gt;
  HTTP/1.1&lt;br /&gt;
HOST: {Authorization Server}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: The snippet above contains request parameters from RFC 7636 in addition to ones from RFC 6749. See PKCE Authorization Request for details.&lt;br /&gt;
=== Response From Authorization Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Found&lt;br /&gt;
Location: {Redirect URI}&lt;br /&gt;
  ?code={Authorization Code}  // - Always included&lt;br /&gt;
  &amp;amp;state={Arbitrary String}   // - Included if the authorization&lt;br /&gt;
                              //   request included 'state'.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Request To Token Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST {Token Endpoint} HTTP/1.1&lt;br /&gt;
Host: {Authorization Server}&lt;br /&gt;
Content-Type: application/x-www-form-urlencoded&lt;br /&gt;
grant_type=authorization_code  // - Required&lt;br /&gt;
&amp;amp;code={Authorization Code}     // - Required&lt;br /&gt;
&amp;amp;redirect_uri={Redirect URI}   // - Required if the authorization&lt;br /&gt;
                               //   request included 'redirect_uri'.&lt;br /&gt;
&amp;amp;code_verifier={Verifier}      // - Required if the authorization&lt;br /&gt;
                               //   request included&lt;br /&gt;
                               //   'code_challenge'.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: The snippet above contains request parameters from RFC 7636 in addition to ones from RFC 6749. See PKCE Token Request for details.&lt;br /&gt;
If the client type of the client application is “public”, the client_id request parameter is additionally required. On the other hand, if the client type is “confidential”, depending on the client authentication method, an Authorization HTTP header, a pair of client_id &amp;amp; client_secret parameters, or some other input parameters are required. See “OAuth 2.0 Client Authentication” for details.&lt;br /&gt;
=== Response From Token Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Content-Type: application/json;charset=UTF-8&lt;br /&gt;
Cache-Control: no-store&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;access_token&amp;quot;: &amp;quot;{Access Token}&amp;quot;,    // - Always included&lt;br /&gt;
  &amp;quot;token_type&amp;quot;: &amp;quot;{Token Type}&amp;quot;,        // - Always included&lt;br /&gt;
  &amp;quot;expires_in&amp;quot;: {Lifetime In Seconds}, // - Optional&lt;br /&gt;
  &amp;quot;refresh_token&amp;quot;: &amp;quot;{Refresh Token}&amp;quot;,  // - Optional&lt;br /&gt;
  &amp;quot;scope&amp;quot;: &amp;quot;{Scopes}&amp;quot;                  // - Mandatory if the granted&lt;br /&gt;
                                       //   scopes differ from the&lt;br /&gt;
                                       //   requested ones.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Implicit Flow ==&lt;br /&gt;
A client application (a) makes an authorization request to an authorization endpoint and (b) gets an access token directly from the authorization endpoint.&lt;br /&gt;
[[File:Oauth2.png]]&lt;br /&gt;
=== Request To Authorization Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GET {Authorization Endpoint}&lt;br /&gt;
  ?response_type=token          // - Required&lt;br /&gt;
  &amp;amp;client_id={Client ID}        // - Required&lt;br /&gt;
  &amp;amp;redirect_uri={Redirect URI}  // - Conditionally required&lt;br /&gt;
  &amp;amp;scope={Scopes}               // - Optional&lt;br /&gt;
  &amp;amp;state={Arbitrary String}     // - Recommended&lt;br /&gt;
  HTTP/1.1&lt;br /&gt;
HOST: {Authorization Server}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
=== Response From Authorization Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 302 Found&lt;br /&gt;
Location: {Redirect URI}&lt;br /&gt;
  #access_token={Access Token}       // - Always included&lt;br /&gt;
  &amp;amp;token_type={Token Type}           // - Always included&lt;br /&gt;
  &amp;amp;expires_in={Lifetime In Seconds}  // - Optional&lt;br /&gt;
  &amp;amp;state={Arbitrary String}          // - Included if the request&lt;br /&gt;
                                     //   included 'state'.&lt;br /&gt;
  &amp;amp;scope={Scopes}                    // - Mandatory if the granted&lt;br /&gt;
                                     //   scopes differ from the&lt;br /&gt;
                                     //   requested ones.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Implicit Flow does not issue refresh tokens.&lt;br /&gt;
&lt;br /&gt;
== Resource Owner Password Credentials Flow ==&lt;br /&gt;
A client application (a) makes a token request to a token endpoint and (b) gets an access token. In this flow, a client application accepts a user's ID and password although the primary purpose of OAuth 2.0 is to give limited permissions to a client application WITHOUT revealing the user's credentials to the client application.&lt;br /&gt;
[[File:Oauth3.png]]&lt;br /&gt;
=== Request To Token Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST {Token Endpoint} HTTP/1.1&lt;br /&gt;
Host: {Authorization Server}&lt;br /&gt;
Content-Type: application/x-www-form-urlecoded&lt;br /&gt;
grant_type=password    // - Required&lt;br /&gt;
&amp;amp;username={User ID}    // - Required&lt;br /&gt;
&amp;amp;password={Password}   // - Required&lt;br /&gt;
&amp;amp;scope={Scopes}        // - Optional&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the client type of the client application is “public”, the client_id request parameter is additionally required. On the other hand, if the client type is “confidential”, depending on the client authentication method, an Authorization HTTP header, a pair of client_id &amp;amp; client_secret parameters, or some other input parameters are required. See “OAuth 2.0 Client Authentication” for details.&lt;br /&gt;
=== Response From Token Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Content-Type: application/json;charset=UTF-8&lt;br /&gt;
Cache-Control: no-store&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;access_token&amp;quot;: &amp;quot;{Access Token}&amp;quot;,    // - Always included&lt;br /&gt;
  &amp;quot;token_type&amp;quot;: &amp;quot;{Token Type}&amp;quot;,        // - Always included&lt;br /&gt;
  &amp;quot;expires_in&amp;quot;: {Lifetime In Seconds}, // - Optional&lt;br /&gt;
  &amp;quot;refresh_token&amp;quot;: &amp;quot;{Refresh Token}&amp;quot;,  // - Optional&lt;br /&gt;
  &amp;quot;scope&amp;quot;: &amp;quot;{Scopes}&amp;quot;                  // - Mandatory if the granted&lt;br /&gt;
                                       //   scopes differ from the&lt;br /&gt;
                                       //   requested ones.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Client Credentials Flow ==&lt;br /&gt;
A client application (a) makes a token request to a token endpoint and (b) gets an access token. In this flow, user authentication is not performed and client application authentication only is performed.&lt;br /&gt;
&lt;br /&gt;
[[File:Oauth4.png]]&lt;br /&gt;
&lt;br /&gt;
=== Request To Token Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST {Token Endpoint} HTTP/1.1&lt;br /&gt;
Host: {Authorization Server}&lt;br /&gt;
Authorization: Basic {Client Credentials}&lt;br /&gt;
Content-Type: application/x-www-form-urlecoded&lt;br /&gt;
grant_type=client_credentials  // - Required&lt;br /&gt;
&amp;amp;scope={Scopes}                // - Optional&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Client Credentials Flow is allowed only for confidential clients (cf. RFC 6749, 2.1. Client Types). As a result, Authorization header, a pair of client_id &amp;amp; client_secret parameters, or some other input parameters for client authentication are required. See “OAuth 2.0 Client Authentication” for details.&lt;br /&gt;
=== Response From Token Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Content-Type: application/json;charset=UTF-8&lt;br /&gt;
Cache-Control: no-store&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;access_token&amp;quot;: &amp;quot;{Access Token}&amp;quot;,    // - Always included&lt;br /&gt;
  &amp;quot;token_type&amp;quot;: &amp;quot;{Token Type}&amp;quot;,        // - Always included&lt;br /&gt;
  &amp;quot;expires_in&amp;quot;: {Lifetime In Seconds}, // - Optional&lt;br /&gt;
  &amp;quot;scope&amp;quot;: &amp;quot;{Scopes}&amp;quot;                  // - Mandatory if the granted&lt;br /&gt;
                                       //   scopes differ from the&lt;br /&gt;
                                       //   requested ones.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The specification says Client Credentials Flow should not issue refresh tokens.&lt;br /&gt;
== Refresh Token Flow ==&lt;br /&gt;
 A client application (a) presents a refresh token to a token endpoint and (b) gets a new access token.&lt;br /&gt;
[[File:Oauth5.png]]&lt;br /&gt;
=== Request To Token Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
POST {Token Endpoint} HTTP/1.1&lt;br /&gt;
Host: {Authorization Server}&lt;br /&gt;
Content-Type: application/x-www-form-urlecoded&lt;br /&gt;
grant_type=refresh_token        // - Required&lt;br /&gt;
&amp;amp;refresh_token={Refresh Token}  // - Required&lt;br /&gt;
&amp;amp;scope={Scopes}                 // - Optional&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
If the client type of the client application is “public”, the client_id request parameter is additionally required. On the other hand, if the client type is “confidential”, depending on the client authentication method, an Authorization HTTP header, a pair of client_id &amp;amp; client_secret parameters, or some other input parameters are required. See “OAuth 2.0 Client Authentication” for details.&lt;br /&gt;
=== Response From Token Endpoint ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Content-Type: application/json;charset=UTF-8&lt;br /&gt;
Cache-Control: no-store&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;access_token&amp;quot;: &amp;quot;{Access Token}&amp;quot;,    // - Always included&lt;br /&gt;
  &amp;quot;token_type&amp;quot;: &amp;quot;{Token Type}&amp;quot;,        // - Always included&lt;br /&gt;
  &amp;quot;expires_in&amp;quot;: {Lifetime In Seconds}, // - Optional&lt;br /&gt;
  &amp;quot;refresh_token&amp;quot;: &amp;quot;{Refresh Token}&amp;quot;,  // - Optional&lt;br /&gt;
  &amp;quot;scope&amp;quot;: &amp;quot;{Scopes}&amp;quot;                  // - Mandatory if the granted&lt;br /&gt;
                                       //   scopes differ from the&lt;br /&gt;
                                       //   original ones.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
== Appendix ==&lt;br /&gt;
“Semi-hosted service pattern” is a new architecture of OAuth 2.0 and OpenID Connect implementation. In the pattern, a frontend server (an authorization server and an OpenID provider) utilizes a backend service which provides APIs to help the frontend server implement OAuth 2.0 and OpenID Connect. [https://www.authlete.com/ Authlete] is a real-world example of such backend services. The figure below illustrates the relationship between a frontend server and a backend service  &lt;br /&gt;
[[File:Oauth6.png]]&lt;br /&gt;
The primary advantage of this architecture is in that the core part of OAuth 2.0 and OpenID Connect implementation is clearly separated from other technical components such as identity management, user authentication, login session management, API management and fraud detection.&lt;br /&gt;
&lt;br /&gt;
For example, the following diagram illustrates how user authentication is separated from OAuth 2.0 implementation. Please read “New Architecture of OAuth 2.0 and OpenID Connect Implementation” for details about the semi-hosted service pattern and its architectural advantages.&lt;br /&gt;
[[File:Oauth7.png]]&lt;/div&gt;</summary>
		<author><name>AliIybar</name></author>	</entry>

	</feed>