{"id":16716271,"url":"https://github.com/rayluo/python-webapp-quart","last_synced_at":"2025-10-11T05:32:31.401Z","repository":{"id":240628309,"uuid":"802693141","full_name":"rayluo/python-webapp-quart","owner":"rayluo","description":"A web app sample written for Quart web framework, powered by Identity library","archived":false,"fork":false,"pushed_at":"2024-06-23T02:49:26.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T05:31:57.977Z","etag":null,"topics":["auth","authentication","entra","entra-id","identity","quart"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/identity/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rayluo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-19T02:09:31.000Z","updated_at":"2024-06-23T02:53:02.000Z","dependencies_parsed_at":"2024-05-20T08:26:02.976Z","dependency_job_id":"99a27f98-4f54-4e6e-964f-3e5454c23d87","html_url":"https://github.com/rayluo/python-webapp-quart","commit_stats":null,"previous_names":["rayluo/python-webapp-quart"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rayluo/python-webapp-quart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayluo%2Fpython-webapp-quart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayluo%2Fpython-webapp-quart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayluo%2Fpython-webapp-quart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayluo%2Fpython-webapp-quart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rayluo","download_url":"https://codeload.github.com/rayluo/python-webapp-quart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rayluo%2Fpython-webapp-quart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006320,"owners_count":26084085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auth","authentication","entra","entra-id","identity","quart"],"created_at":"2024-10-12T21:12:38.064Z","updated_at":"2025-10-11T05:32:31.375Z","avatar_url":"https://github.com/rayluo.png","language":"Python","readme":"# Integrating Microsoft Entra ID with a Python web application written in Quart\r\n\r\nThis is a multi-purpose [Quart](https://palletsprojects.com/p/quart/) web app sample.\r\nWrite your app like this once, and the same implementation will support 4x2=8 scenarios.\r\n\r\n|                | Microsoft Entra ID | External ID | External ID with Custom Domain | Azure AD B2C |\r\n|----------------|--------------------|-------------|--------------------------------|--------------|\r\n| Web App Sign-In \u0026 Sign-Out |   ✓    |      ✓      |                ✓               |       ✓      |\r\n| Web App Calls a web API |     ✓     |      ✓      |                ✓               |       ✓      |\r\n\r\n![Topology](https://raw.githubusercontent.com/Azure-Samples/ms-identity-python-webapp-django/main/static/topology.png)\r\n\r\n## Getting Started\r\n\r\n### Prerequisites\r\n\r\n1. Have [Python](https://python.org) 3.8+ installed\r\n1. Clone from this repo\r\n   or download its zip package, and then start using it or build on top of it.\r\n1. `cd project_name`\r\n1. Run `pip install -r requirements.txt` to install dependencies\r\n1.  Run `quart run -h localhost` and then browse to http://localhost:5000\r\n   You may need to change to a different port to match your redirect_uri setup.\r\n\r\n\r\n### How to configure and use this sample\r\n\r\n\u003ctable border=1\u003e\r\n  \u003ctr\u003e\r\n    \u003cth\u003e\u003c/th\u003e\r\n    \u003cth\u003eMicrosoft Entra ID\u003c/th\u003e\r\n    \u003cth\u003eMicrosoft Entra External ID\u003c/th\u003e\r\n    \u003cth\u003eMicrosoft Entra External ID with Custom Domain\u003c/th\u003e\r\n    \u003cth\u003eAzure AD B2C\u003c/th\u003e\r\n  \u003c/tr\u003e\r\n\r\n  \u003ctr\u003e\r\n    \u003cth\u003eApp Registration\u003c/th\u003e\r\n    \u003ctd\u003e\u003c!-- See https://github.com/github/cmark-gfm/issues/12 --\u003e\r\n\r\nFollowing only the step 1, 2 and 3  of this\r\n[Quickstart: Add sign-in with Microsoft to a Python web app](https://learn.microsoft.com/entra/identity-platform/quickstart-web-app-python-sign-in?tabs=windows)\r\n\r\n\u003c/td\u003e\r\n    \u003ctd\u003e\r\n\r\nFollow only the page 1 of this [Tutorial: Prepare your customer tenant ...](https://learn.microsoft.com/entra/external-id/customers/tutorial-web-app-python-flask-prepare-tenant)\r\n\r\n\u003c/td\u003e\r\n    \u003ctd\u003e\r\n\r\nComing soon.\r\n\r\n\u003c/td\u003e\r\n    \u003ctd\u003e\r\n\r\nFollowing only the step 1 and 2 (including 2.1 and 2.2) of this\r\n[Configure authentication in a sample Python web app by using Azure AD B2C](https://learn.microsoft.com/azure/active-directory-b2c/configure-authentication-sample-python-web-app?tabs=linux)\r\n\r\n\u003c/td\u003e\r\n  \u003c/tr\u003e\r\n\r\n  \u003ctr\u003e\r\n    \u003cth rowspan=2\u003eConfiguration\u003c/th\u003e\r\n    \u003ctd\u003e\u003c!-- See https://github.com/github/cmark-gfm/issues/12 --\u003e\r\n\r\nCopy this [Entra ID template](.env.sample.entra-id)\r\nas `.env` and then modify `.env` with your app's settings.\r\n\r\n\u003c/td\u003e\r\n    \u003ctd\u003e\r\n\r\nCopy this [External ID template](.env.sample.external-id)\r\nas `.env` and then modify `.env` with your app's settings.\r\n\r\n\u003c/td\u003e\r\n    \u003ctd\u003e\r\n\r\nCopy this [External ID with Custom Domain template](.env.sample.external-id-custom-domain)\r\nas `.env` and then modify `.env` with your app's settings.\r\n\r\n\u003c/td\u003e\r\n    \u003ctd\u003e\r\n\r\nCopy this [Azure AD B2C template](.env.sample.b2c)\r\nas `.env` and then modify `.env` with your app's settings.\r\n\r\n\u003c/td\u003e\r\n  \u003c/tr\u003e\r\n\r\n  \u003ctr\u003e\r\n    \u003ctd colspan=4\u003e\r\n\r\nDo not reverse the order of the configuration steps above.\r\nIf you put your app credentials into the template and then copy it into `.env`,\r\nyou risk accidentally committing your templates with credentials into Version Control System.\r\n\r\n\u003c/td\u003e\r\n  \u003c/tr\u003e\r\n\r\n  \u003ctr\u003e\r\n    \u003cth\u003eWeb App Sign In \u0026 Sign Out\u003c/th\u003e\r\n    \u003ctd colspan=4\u003e\r\n\r\nWith the basic configuration above,\r\nyou can now browse to the index page of this sample to try the sign-in/sign-out experience.\r\n\r\n\u003c/td\u003e\r\n  \u003c/tr\u003e\r\n\r\n  \u003ctr\u003e\r\n    \u003cth\u003eWeb App Calls a web API\u003c/th\u003e\r\n    \u003ctd colspan=4\u003e\r\n\r\nAdd the web API's *endpoint* into your `.env` file.\r\nAlso add the *scopes* it needs, separated by space.\r\nThe following example is the settings needed to call the Microsoft Graph API.\r\nYou may need to replace the their values with your own API endpoint and its scope..\r\n\r\n```ini\r\nENDPOINT=https://graph.microsoft.com/v1.0/me\r\nSCOPE=User.Read\r\n```\r\n\r\nNow restart this sample and try its \"Call API\" experience.\r\n\r\n\u003c/td\u003e\r\n  \u003c/tr\u003e\r\n\r\n  \u003ctr\u003e\r\n    \u003cth\u003e\r\n\r\nDeploy to\r\n[Azure App Service](https://azure.microsoft.com/en-us/products/app-service)\r\n\r\n\u003c/th\u003e\r\n    \u003ctd colspan=4\u003e\r\n\r\n* Follow the [\"Quickstart: Deploy a Python (Django or Flask) web app to Azure App Service\"](https://learn.microsoft.com/en-us/azure/app-service/quickstart-python),\r\n  but replace its sample app (which does not do user sign-in) with this web app.\r\n* [Configure your app's settings](https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal#configure-app-settings)\r\n  to define environment variables mentioned in the **Configuration** row of this table.\r\n* If your session is NOT stored in a centralized location,\r\n  you shall turn on \"session affinity\" (a.k.a. \"ARR affinity\") in your\r\n  [App Service Web App's Configuration](https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal#configure-general-settings)\r\n\r\n\u003c/td\u003e\r\n  \u003c/tr\u003e\r\n\r\n\u003c/table\u003e\r\n\r\n\r\n## How to build this sample (or a new web project) from scratch\r\n\r\nYou can follow the\r\n[instructions for Quart, from the underlying library](https://identity-library.readthedocs.io/en/latest/quart.html).\r\n\r\nYou can refer to the\r\nsource code of this sample\r\nto pick up other minor details, such as how to modify `app.py` accordingly,\r\nand how to add templates for the new view (and for the existing `index()` view).\r\n\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayluo%2Fpython-webapp-quart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frayluo%2Fpython-webapp-quart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frayluo%2Fpython-webapp-quart/lists"}