{"id":27854140,"url":"https://github.com/ilgalvo/winui3-oauth2manager-sample","last_synced_at":"2025-09-09T11:34:28.014Z","repository":{"id":290247729,"uuid":"973790745","full_name":"IlGalvo/WinUI3-OAuth2Manager-Sample","owner":"IlGalvo","description":"WinUI3 OAuth2Manager Client/Server Sample","archived":false,"fork":false,"pushed_at":"2025-04-27T20:41:59.000Z","size":39,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-04T08:59:18.244Z","etag":null,"topics":["authentication","csharp","desktop-app","dotnet","oauth2","oauth2manager","server-app","windows-app-sdk-app","winui3"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IlGalvo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2025-04-27T18:38:12.000Z","updated_at":"2025-04-30T09:30:46.000Z","dependencies_parsed_at":"2025-04-27T21:30:04.676Z","dependency_job_id":"f3d3da9c-81a0-4b1a-b07c-2425fbe27450","html_url":"https://github.com/IlGalvo/WinUI3-OAuth2Manager-Sample","commit_stats":null,"previous_names":["ilgalvo/winui3oauth2managersample","ilgalvo/winui3-oauth2manager-sample"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlGalvo%2FWinUI3-OAuth2Manager-Sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlGalvo%2FWinUI3-OAuth2Manager-Sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlGalvo%2FWinUI3-OAuth2Manager-Sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IlGalvo%2FWinUI3-OAuth2Manager-Sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IlGalvo","download_url":"https://codeload.github.com/IlGalvo/WinUI3-OAuth2Manager-Sample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252310955,"owners_count":21727516,"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","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":["authentication","csharp","desktop-app","dotnet","oauth2","oauth2manager","server-app","windows-app-sdk-app","winui3"],"created_at":"2025-05-04T08:59:21.319Z","updated_at":"2025-05-04T08:59:22.124Z","avatar_url":"https://github.com/IlGalvo.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WinUI3 OAuth2Manager Client/Server Sample \n\n## Overview\n\nThis is a full-stack example demonstrating how to integrate the **Windows App SDK**’s **OAuth2Manager** in a **WinUI 3** client alongside a minimal **ASP.NET Core** authorization server powered by **OpenIddict**. The **Client** project shows how to launch the system browser to perform the Authorization Code + PKCE flow and receive the callback via protocol activation, while the **Server** project implements an in-memory OpenIddict server exposing `/authorize` and `/token` endpoints for rapid local testing.\n\n## Table of Contents\n\n- [Prerequisites](#prerequisites)\n- [Getting Started](#getting-started)\n- [Project Structure](#project-structure)\n- [Usage](#usage)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Prerequisites\n\n- **Windows 10 (1809+) or Windows 11** with the **Windows App SDK** installed (v1.7 or later).\n- **Visual Studio 2022** with the **.NET 8+** and **Windows App SDK** workloads.\n- **.NET 8 SDK** or newer for building both client and server.\n\n## Getting Started\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/IlGalvo/WinUI3OAuth2ManagerSample.git\n   cd WinUI3OAuth2ManagerSample\n   ```\n2. **Run the Server**\n   - Open `Server/Server.sln` in Visual Studio.\n   - Set **Server** as the startup project and press **F5**.\n   - The server will start on and host the OpenIddict endpoints.\n3. **Run the Client**\n   - Open `Client/Client.sln` in Visual Studio.\n   - Set **Client** as the startup project and press **F5**.\n   - Click the **Authorize** button to launch the browser and start the OAuth 2.0 flow.\n\n## Project Structure\n\n```\nWinUI3OAuth2ManagerSample/\n├─ Client/\n│  └─ Client/         ← WinUI 3 desktop app using OAuth2Manager\n└─ Server/\n   └─ Server/         ← ASP.NET Core Web API with OpenIddict (in-memory)\n```\n\n- **Client/Client**: Implements `OAuth2Manager.RequestAuthWithParamsAsync` to open the browser and `ProtocolActivation` to capture the redirect URI. Uses `ActivationRegistrationManager` to register custom URI schemes when unpackaged.\n- **Server/Server**: Configures OpenIddict for Authorization Code + PKCE, in-memory stores, and ephemeral keys. Exposes `/connect/authorize` and `/connect/token` endpoints.\n\n## Usage\n\n1. In the **Client** app, click **Authorize**. The system browser navigates to auth URI.\n2. The **Server** prompts for user consent and issues an authorization code.\n3. The **Client** intercepts the custom URI callback via protocol activation.\n\n## Contributing\n\nContributions are welcome! Please open issues and pull requests to:\n\n- Improve documentation and add detailed README instructions.\n- Enhance error handling and implement token management in the client.\n- Extend the server with refresh tokens, user management, or external identity providers.\n\n## License\n\nThis sample is licensed under the See [LICENSE](LICENSE.md) for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filgalvo%2Fwinui3-oauth2manager-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filgalvo%2Fwinui3-oauth2manager-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filgalvo%2Fwinui3-oauth2manager-sample/lists"}