{"id":18772642,"url":"https://github.com/authgear/authgear-example-dotnet","last_synced_at":"2025-04-13T08:31:49.785Z","repository":{"id":198925453,"uuid":"677683026","full_name":"authgear/authgear-example-dotnet","owner":"authgear","description":"Authentication for ASP.NET apps with Authgear and OpenID Connect","archived":false,"fork":false,"pushed_at":"2024-03-19T13:09:37.000Z","size":13,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-03-27T00:23:01.566Z","etag":null,"topics":["asp-net-core","authentication","dotnet","oidc"],"latest_commit_sha":null,"homepage":"https://docs.authgear.com/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/authgear.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2023-08-12T09:31:09.000Z","updated_at":"2024-03-10T05:19:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9a253da-9baf-4297-b327-834f07a14c54","html_url":"https://github.com/authgear/authgear-example-dotnet","commit_stats":null,"previous_names":["authgear/authgear-example-dotnet"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authgear%2Fauthgear-example-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authgear%2Fauthgear-example-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authgear%2Fauthgear-example-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/authgear%2Fauthgear-example-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/authgear","download_url":"https://codeload.github.com/authgear/authgear-example-dotnet/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248684322,"owners_count":21145056,"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":["asp-net-core","authentication","dotnet","oidc"],"created_at":"2024-11-07T19:29:47.805Z","updated_at":"2025-04-13T08:31:49.512Z","avatar_url":"https://github.com/authgear.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Authentication for ASP.NET apps with Authgear and OpenID Connect\n\nThis repo provides a basic demo web application, created using [ASP.NET](http://ASP.NET), and demonstrates how to add authentication features with [Authgear](https://www.authgear.com/) by implementing an [OpenID Connect](https://docs.authgear.com/concepts/identity-fundamentals#open-id-connect) flow, then retrieving OAuth tokens, in order to call APIs.\n\n## What is Authgear?\n\n[Authgear](https://www.authgear.com/) acts as an IAM provider that is a **gatekeeper to the resources** you provide to customers as web and mobile applications, APIs, etc. The gatekeeper initiates authorization as outlined in [OAuth 2.0](https://www.notion.so/concepts/identity-fundamentals#oauth-2.0). The addition of the [OpenID Connect](https://www.notion.so/concepts/identity-fundamentals#open-id-connect) layer adds authentication to secure your users’ digital identities and your product.\n\n## How to run the project\n\n## Prerequisites\n\nBefore you get started, you will need the following:\n\n- A **free Authgear account**. [Sign up](https://oursky.typeform.com/to/S5lvI8rN) if you don't have one already.\n- [.NET 7](https://dotnet.microsoft.com/en-us/download) downloaded and installed on your machine. You can also use [Visual Studio](https://visualstudio.microsoft.com/) and [VS code](https://code.visualstudio.com/) to automatically detect the .NET version.\n- Create [Authgear OIDC Client App](https://docs.authgear.com/how-to-guide/authenticate/oidc-provider#setting-up-authgear-in-the-portal) to use it as an OpenID Connect Provider.\n\nStart by cloning the project into your local machine:\n\n```bash\ngit clone https://github.com/authgear/authgear-example-dotnet.git\n```\n\nMake the project directory your current working directory:\n\n```bash\ncd authgear-example-dotnet\n```\n\nUpdate the following configuration variables in the `appsettings.json` file with your Authgear app settings values from **Authgear OIDC Client application** such as `Issuer`, `ClientId`, `ClientSecret`, and Authgear endpoint:\n\n```bash\n{\n    \"OpenIDConnect\": {\n        \"ClientId\": \"{your-client-id}\",\n        \"ClientSecret\": \"{your-client-secret}\",\n        \"Issuer\": \"{your-authgear-app-endpoint}\",\n        \"Scope\": \"openid offline_access\",\n        \"PostLogoutRedirectUri\": \"http://localhost:5002\",\n        \"TokenEndpoint\": \"{your-authgear-app-endpoint}/oauth2/token\"\n    },\n    \"Urls\": \"http://localhost:5002\",\n    \"Logging\": {\n        \"LogLevel\": {\n            \"Default\": \"Information\",\n            \"Microsoft\": \"Warning\",\n            \"Microsoft.Hosting.Lifetime\": \"Information\"\n        }\n    }\n}\n```\n\nExecute the following command to run the [ASP.NET](http://asp.net/) Core web application:\n\n```bash\ndotnet build\ndotnet run\n```\n\nYou can now visit [](http://localhost:5002)[http://localhost:5002](http://localhost:5002/) to access the application. When you click on the **\"View Protected Data\"** button, ASP.NET Core takes you to the **Authgear’s Login page**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthgear%2Fauthgear-example-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fauthgear%2Fauthgear-example-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fauthgear%2Fauthgear-example-dotnet/lists"}