<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>OAuth on NASAN</title><link>https://nasan.ch/categories/oauth/</link><description>Recent content in OAuth on NASAN</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 30 Sep 2025 05:10:21 +0100</lastBuildDate><atom:link href="https://nasan.ch/categories/oauth/index.xml" rel="self" type="application/rss+xml"/><item><title>OAuth 2.0 - Tutorial 3 - Expose and Access a Web API - Resource Server</title><link>https://nasan.ch/posts/2025-09-30-oauth20-3/</link><pubDate>Tue, 30 Sep 2025 05:10:21 +0100</pubDate><guid>https://nasan.ch/posts/2025-09-30-oauth20-3/</guid><description>&lt;h2 id="previous-tutorials"&gt;Previous tutorials&lt;/h2&gt;
&lt;p&gt;In the previous tutorials:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nasan.ch/posts/2025-09-27-OAuth20-1-LocalhostPythonWebApp-AuthCodeFlow" rel=""&gt;OAuth 2.0 - Tutorial 1 - Localhost Python WebApp Auth Code Flow with Entra ID&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nasan.ch/posts/2025-09-27-OAuth20-2-AzureServerSidePythonWebApp-AuthCodeFlow" rel=""&gt;OAuth 2.0 - Tutorial 2 - Azure Server Side Python WebApp Auth Code Flow - Entra ID&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We learned:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How to create a &amp;ldquo;server-side&amp;rdquo; Python Web App
&lt;ul&gt;
&lt;li&gt;How to deploy this app to Azure&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;How to register the app with Entra ID&lt;/li&gt;
&lt;li&gt;How to use the Authorization Code Flow to access the Microsoft Graph API.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="overview"&gt;Overview&lt;/h2&gt;
&lt;p&gt;In this tutorial:&lt;/p&gt;</description></item><item><title>OAuth 2.0 - Tutorial 2 - Azure Server Side Python WebApp Auth Code Flow - Entra ID</title><link>https://nasan.ch/posts/2025-09-27-oauth20-2-azureserversidepythonwebapp-authcodeflow/</link><pubDate>Mon, 29 Sep 2025 05:10:21 +0100</pubDate><guid>https://nasan.ch/posts/2025-09-27-oauth20-2-azureserversidepythonwebapp-authcodeflow/</guid><description>&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;In the previous tutorial &lt;a href="https://nasan.ch/posts/2025-09-27-OAuth20-1-LocalhostPythonWebApp-AuthCodeFlow" rel=""&gt;Localhost Python WebApp Auth Code Flow with Entra ID&lt;/a&gt; , we demonstrated using a localhost web app as a &amp;ldquo;server-side app&amp;rdquo; (confidential client) with the Authorization Code Flow. In this tutorial, we will deploy the app to Azure, making it a true &amp;ldquo;server-side app&amp;rdquo; where users cannot access secrets.&lt;/p&gt;
&lt;p&gt;The following steps are required to deploy the app to Azure:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Create an Azure Container Registry&lt;/li&gt;
&lt;li&gt;Create a Dockerfile and publish the image to the registry&lt;/li&gt;
&lt;li&gt;Create an Azure Web App using this container&lt;/li&gt;
&lt;li&gt;Add environment variables (tenant, client ID, client secret)&lt;/li&gt;
&lt;li&gt;Add a new redirect URI to the app registration&lt;/li&gt;
&lt;li&gt;Update the redirect URI in the app code&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="prerequisites"&gt;Prerequisites&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Microsoft Azure Tenant with active Subscription&lt;/li&gt;
&lt;li&gt;Docker installed&lt;/li&gt;
&lt;li&gt;Azure CLI installed&lt;/li&gt;
&lt;li&gt;UV installed: &lt;a href="https://docs.astral.sh/uv/getting-started/installation/" target="_blank" rel="noopener noreffer"&gt;UV Installation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="create-azure-container-registry"&gt;Create Azure Container Registry&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal?tabs=azure-cli" target="_blank" rel="noopener noreffer"&gt;Create an Azure container registry&lt;/a&gt; where you can store your docker images:&lt;/p&gt;</description></item><item><title>OAuth 2.0 - Tutorial 1 - Localhost Python WebApp Auth Code Flow with Entra ID</title><link>https://nasan.ch/posts/2025-09-27-oauth20-1-localhostpythonwebapp-authcodeflow/</link><pubDate>Sun, 28 Sep 2025 05:10:21 +0100</pubDate><guid>https://nasan.ch/posts/2025-09-27-oauth20-1-localhostpythonwebapp-authcodeflow/</guid><description>&lt;h2 id="introduction---server-side-app---auth-code-flow"&gt;Introduction - &amp;ldquo;Server Side App&amp;rdquo; - Auth Code Flow&lt;/h2&gt;
&lt;p&gt;This guide demonstrates how to create a &amp;ldquo;server-side&amp;rdquo; &lt;strong&gt;Python web application&lt;/strong&gt; running locally (for development) that authenticates users with &lt;strong&gt;Microsoft Entra ID&lt;/strong&gt; and authorizes access to the &lt;strong&gt;Microsoft Graph API&lt;/strong&gt; using the &lt;strong&gt;Authorization Code Flow&lt;/strong&gt; as a &lt;strong&gt;&amp;ldquo;confidential client&amp;rdquo;&lt;/strong&gt; with a client secret.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Info:&lt;/strong&gt;
In the second tutorial, we will deploy this app to Azure&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;The client is considered confidential because the app runs solely on the server, and users do not have access to the client secret.&lt;/p&gt;</description></item><item><title>OAuth 2.0 - mind map</title><link>https://nasan.ch/posts/2025-09-27-oauth20-0-overview/</link><pubDate>Sat, 27 Sep 2025 05:10:21 +0100</pubDate><guid>https://nasan.ch/posts/2025-09-27-oauth20-0-overview/</guid><description>&lt;p&gt;To better understand OAuth 2.0, I have created the following mind map and a series of follow-up tutorials that provide a basic overview of how OAuth works.&lt;/p&gt;
&lt;h2 id="mindmap-oauth"&gt;MindMap OAuth&lt;/h2&gt;
&lt;p&gt;&lt;figure&gt;&lt;a class="lightgallery" href="https://nasan.ch/images/OAuth2-0.svg" title="AUTH 2.0 Mind Map" data-thumbnail="/images/OAuth2-0.svg" data-sub-html="&lt;h2&gt;OAUTH 2.0 Mind Map illustrates basic concepts&lt;/h2&gt;&lt;p&gt;AUTH 2.0 Mind Map&lt;/p&gt;"&gt;
 &lt;img
 class="lazyload"
 src="https://nasan.ch/svg/loading.min.svg"
 data-src="https://nasan.ch/images/OAuth2-0.svg"
 data-srcset="https://nasan.ch/images/OAuth2-0.svg, https://nasan.ch/images/OAuth2-0.svg 1.5x, https://nasan.ch/images/OAuth2-0.svg 2x"
 data-sizes="auto"
 alt="/images/OAuth2-0.svg" /&gt;
 &lt;/a&gt;&lt;figcaption class="image-caption"&gt;OAUTH 2.0 Mind Map illustrates basic concepts&lt;/figcaption&gt;
 &lt;/figure&gt;&lt;br&gt;
&lt;em&gt;Figure 1: OAUTH 2.0 Mind Map visualizing basic concepts&lt;/em&gt;&lt;/p&gt;</description></item></channel></rss>