Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fschick/keycloak.aspnet.angular
How to: ASP.NET Core with OAuth2 (Keycloak) and Angular
https://github.com/fschick/keycloak.aspnet.angular
angular aps-net asp-net-core authentication authorization csharp keycloak oauth2 openid-connect single-sign-on
Last synced: 23 days ago
JSON representation
How to: ASP.NET Core with OAuth2 (Keycloak) and Angular
- Host: GitHub
- URL: https://github.com/fschick/keycloak.aspnet.angular
- Owner: fschick
- License: mit
- Created: 2023-01-15T14:12:59.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-08T08:23:52.000Z (about 2 months ago)
- Last Synced: 2024-11-08T09:26:58.668Z (about 2 months ago)
- Topics: angular, aps-net, asp-net-core, authentication, authorization, csharp, keycloak, oauth2, openid-connect, single-sign-on
- Language: C#
- Homepage:
- Size: 1.87 MB
- Stars: 40
- Watchers: 2
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# How to: Keycloak - ASP.NET Core - Angular
Code to demonstrate how to use Keycloak with ASP.NET, OpenAPI UI (formerly Swagger) and Angular
**HINT**: Although this repository demonstrates the use of UMA, it is not necessarily the best use case. In many scenarios, [role-based authorization](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/authorization-via-roles) may be perfectly adequate.
**WARNING**: Most security features are disabled for this demo. Before using Keycloak in production, your application must be [secured](https://www.keycloak.org/docs/latest/securing_apps/index.html).
## Repository
The repository contains feature commits as well as branches for the following steps:
[Demo application without authentication](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/authentication-none)
[Demo application with authentication](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/authentication-only)
[Demo application with authorization via roles](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/authorization-via-roles)
[Demo application with authorization via UMA (user managed access protocol), role based](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/authorization-via-uma-role-based)
[Demo application with authorization via UMA, policy based](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/authorization-via-uma-policy-based)
[Demo application with authorization via UMA, decision API](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/authorization-via-uma-decision-api)
## Project structure
[`slides`](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/main/slides): Slide to the talk about Keycloak with ASP.NET and Angular
[`keycloak`](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/main/keycloak): Export of Keycloak realms according to the steps from above
[`snippets`](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/main/snippets): Code snippets to implement step-by-step
[ `source/backend`](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/main/source/backend): Source code for the back-end server (ASP.NET Core)
[`source/frontend`](https://github.com/fschick/Keycloak.ASPNet.Angular/tree/main/source/frontend): Source code for the front-end (Angular)
## Resources
*An Illustrated Guide to OAuth and OpenID Connect*
https://developer.okta.com/blog/2019/10/21/illustrated-guide-to-oauth-and-oidc*Background information to OAuth and OpenID Connect*
[OAuth 2.0](https://ldapwiki.com/wiki/Wiki.jsp?page=OAuth 2.0#top)
[OpenID Connect](https://ldapwiki.com/wiki/Wiki.jsp?page=OpenID Connect#top)*Use Keycloak as Identity Provider in ASP.NET Core 6*
https://nikiforovall.github.io/aspnetcore/dotnet/2022/08/24/dotnet-keycloak-auth.html*Real-World Application with Keycloak*
https://github.com/fschick/TimeTracking*.NET / C# REST API client for the Keycloak Admin REST API*
https://github.com/fschick/Keycloak.RestApiClient