{"id":22346060,"url":"https://github.com/benjaminabt/samples.aspnetcore-identityserver4","last_synced_at":"2025-07-30T03:32:31.663Z","repository":{"id":130534956,"uuid":"104867359","full_name":"BenjaminAbt/Samples.AspNetCore-IdentityServer4","owner":"BenjaminAbt","description":"IdentityServer4 sample with .NET Core and ASP.NET Core 2.0","archived":false,"fork":false,"pushed_at":"2018-09-12T07:42:49.000Z","size":1278,"stargazers_count":122,"open_issues_count":1,"forks_count":29,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-06T01:06:21.489Z","etag":null,"topics":["aspnetcore","dotnetcore","identityserver4","oauth2"],"latest_commit_sha":null,"homepage":"https://www.benjamin-abt.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BenjaminAbt.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}},"created_at":"2017-09-26T09:51:41.000Z","updated_at":"2024-05-27T04:22:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"634ec34d-f684-4275-919c-0b48c4053914","html_url":"https://github.com/BenjaminAbt/Samples.AspNetCore-IdentityServer4","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BenjaminAbt/Samples.AspNetCore-IdentityServer4","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenjaminAbt%2FSamples.AspNetCore-IdentityServer4","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenjaminAbt%2FSamples.AspNetCore-IdentityServer4/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenjaminAbt%2FSamples.AspNetCore-IdentityServer4/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenjaminAbt%2FSamples.AspNetCore-IdentityServer4/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BenjaminAbt","download_url":"https://codeload.github.com/BenjaminAbt/Samples.AspNetCore-IdentityServer4/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BenjaminAbt%2FSamples.AspNetCore-IdentityServer4/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267803984,"owners_count":24146527,"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-07-30T02:00:09.044Z","response_time":70,"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":["aspnetcore","dotnetcore","identityserver4","oauth2"],"created_at":"2024-12-04T09:19:45.472Z","updated_at":"2025-07-30T03:32:31.652Z","avatar_url":"https://github.com/BenjaminAbt.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Goal \n\nMy goal was to build a sample with\n- .NET Core 2.0 Console\n- ASP.NET Core 2.0 Web App\n- ASP.NET Core 2.0 Web API\n\nAnother goal was to show how the user workflow of application trust should be for \"internal\" platform services as well as for external clients.\n\n## Donations\n\nPlease think twice and donate your money to useful institutions such as [children's hospices](http://www.bundesverband-kinderhospiz.de/spenden).\n\n## Documentation\n\nThis sample shows the following workflow:\n\n![Workflow](img/Workflow.png)\n\nWe have an internal area which represents our trusted application environment. Additionally, we see an external example application we do not develop or run.\n\n## Consent\n\nAll our trusted \"internal\" applications can access all our APIs.\nExternal applications have to be accepted by the user via [IdentityServer Consent](http://docs.identityserver.io/en/release/topics/consent.html)\n\n![IdentityServer4-Sample-Consent](img/IdentityServer4-Sample-Consent.gif)\n\n## Projects\n\n### IdentityServerHost\n\nThis ASP.NET Core 2.0 application hosts the IdentityServer.\nAll configurations like users, APIs and clients are static in the [SampleConfig.cs](src/Platform-IdentityServerHost/SampleConfig.cs) file.\n\nThe IdentityServer is registered inside of [Startup.cs](src/Platform-IdentityServerHost/Startup.cs)\n\nThe sources inside the [Quickstart](src/Platform-IdentityServerHost/Quickstart) are taken from https://github.com/IdentityServer/IdentityServer4.Quickstart.UI without modifications.\n\n### BaseApiSDK\n\nThis projects provides basic stuff for accessing an API with the help of a SDK.\nIn a productive environment this would be a NuGet package.\n\n### TodoApi\n\nThis ASP.NET Core 2.0 application hosts the demo API of todos.\nAll configurations like users, APIs and clients are static in the [ApiSampleOptions.cs](src/Platform-TasksApi/ApiSampleOptions.cs) file.\n\n### TodoApiSdk\n\nThis projects provides a client `TodoApiClient` for accessing the TodoApi.\nIt gives you a client for authentication and receiving typed data.\n\nIn a productive environment this would be a NuGet package.\n\n### PortalWebApp\n\nThis ASP.NET Core 2.0 application represents the \"Portal Web Application\" the user interacts with.\n\nYou have a navigation element to receive the tasks from the TodoApi with the help of the TodoApiSdk and you have a navigation element to watch your claims.\n\nBoth clicks will redirects you to the IdentityServerHost where you have to log in.\nAfterwards to will be redirected to this application.\n\n### ExternalWebApp\n\nThis ASP.NET Core 2.0 application represents an \"External Web Application\" which is not part of the platform and maybe run by an external company.\n\nThis application also provides a navigation element for tasks and claims but after the login the user has to accept the access for this application via via [IdentityServer Consent](http://docs.identityserver.io/en/release/topics/consent.html) as shown above.\n\n### AdminConsoleClient\n\nThis is just a simple console application with a usual name based on .NET Core 2.0.\nIt represents a simple client which calls the API with the TodoApiSdk and hard coded user credentials.\n\nIn a real world scenario this could be any .NET desktop/server/mobile application.\n\n## Run this demo\n\nClone this repository or download this repository as zip file.\n\n```sh\ngit clone https://github.com/BenjaminAbt/Samples.AspNetCore-IdentityServer4.git\n```\n\nSee all information to run this demo below:\n\n### Endpoints\n\n| Application | Url | |\n|-|-|-|\n| Todo API | http://localhost:9011/api/Tasks | Returns a sample task collection |\n| Portal Web | http://localhost:9012/ | \"Internal\" Web App |\n| External Web | http://localhost:9015/ | \"External\" Web App |\n\n### Sample Credentials\n\n\u003e Username: `ben`\n\n\u003e Password: `password`\n\n\n### Portal WebApp\n\nStart `IdentityServerHost`, `TodoApi` and `PortalWebApp` via dotnet.exe on your cmd or use the parallel project startup configuration of Visual Studio (right click on the solution -\u003e set startup projects)\n\n![VS2017-Startup-Projects](img/VS2017-Startup-Projects.png)\n\nOnce started, two browser instances will launch for `IdentityServerHost` and `PortalWebApp`. `TodoApi` will start without a browser instance.\n\n![BrowserStart](img/BrowserStart.png)\n\nClick on `Tasks` in `PortalWebApp`. Unauthorized it will redirect you to the login site of the IdentityServer.\n![Login](img/Login.png)\n\nAfter your login was successful you will be redirected to the Tasks view.\n\nWorkflow: the PortalWebApp application uses the `TodoApi` client to receive the tasks from the `TodoApi`.\n\n![Tasks](img/Tasks.png)\n\n### External WebApp\n\nStart `IdentityServerHost`, `TodoApi` and  `ExternalWebApp`.\n\nClick on `Tasks` and you will have to log into the IdentityServer and accept the application access request.\n\nAfterwards you will be redirected to the WebApp and will see the tasks loaded from the `TodoApi`.\n\n### Admin Console\n\nStart `IdentityServerHost`, `TodoApi`, `AdminConsoleClient`\n\n![VS2017-Startup-Admin](img/VS2017-Startup-Admin.png)\n\nThe console will now authenticate your instance with the hard-coded credentials and will request the `TodoApi` to get the tasks.\n\n![Admin](img/Admin.png)\n\n## License\n\nReleased under [the MIT license](LICENSE).\n\n## Versions\n\n- 1.1 (2017-10-07): Updated to stable release of IdentityServer 2.0\n- 1.0 (2017-09-26): Published\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminabt%2Fsamples.aspnetcore-identityserver4","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbenjaminabt%2Fsamples.aspnetcore-identityserver4","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbenjaminabt%2Fsamples.aspnetcore-identityserver4/lists"}