From 748a7439e73392efe8a8301102842825be380094 Mon Sep 17 00:00:00 2001 From: Hasni Mehdi Date: Sat, 15 Feb 2025 19:51:49 +0100 Subject: [PATCH 1/4] :100: Updated nuget package details --- .../NETCore.Keycloak.Client.csproj | 7 ++ NETCore.Keycloak.Client/README.md | 94 +++++++++++++++++++ README.md | 2 +- 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 NETCore.Keycloak.Client/README.md diff --git a/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj b/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj index 806d0d0..f6c144d 100644 --- a/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj +++ b/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj @@ -9,6 +9,12 @@ Keycloak.NETCore.Client keycloak;oauth2;authentication;authorization;openid-connect;oidc;oidc-provider;fapi;fapi-client;user-managed-access;financial-security black_cockpit.png + https://raw.githubusercontent.com/Black-Cockpit/NETCore.Keycloak/refs/heads/master/LICENSE + MIT + https://github.com/Black-Cockpit/NETCore.Keycloak.git + git + README.md + https://github.com/Black-Cockpit/NETCore.Keycloak net6.0;net7.0;net8.0 latest enable @@ -34,5 +40,6 @@ + diff --git a/NETCore.Keycloak.Client/README.md b/NETCore.Keycloak.Client/README.md new file mode 100644 index 0000000..8df4f54 --- /dev/null +++ b/NETCore.Keycloak.Client/README.md @@ -0,0 +1,94 @@ +# 🔐 Keycloak Client for .NET Core + +🚀 A powerful and feature-rich .NET Core client library for Keycloak that simplifies integration with Keycloak's authentication and authorization services. This enterprise-ready library provides a comprehensive implementation of Keycloak's REST API, with full support for OpenID Connect, OAuth 2.0, and User-Managed Access (UMA 2.0) protocols. + +*** + +## ⚙️ Requirements + +| Category | Supported Versions | +| ------------ | ----------------------------------------------------------------------- | +| .NET | 6.0, 7.0, 8.0 | +| Dependencies | ASP.NET Core, Microsoft.Extensions.DependencyInjection, Newtonsoft.Json | + +## ✅ Version Compatibility + +| Keycloak Version | Support | +| ---------------- | ------- | +| 26.x | ✅ | +| 25.x | ✅ | +| 24.x | ✅ | +| 23.x | ✅ | +| 22.x | ✅ | +| 21.x | ✅ | +| 20.x | ✅ | + +## 🌟 Key Features + +- 🔄 Complete Keycloak REST API integration +- 🛡️ Robust security with OpenID Connect and OAuth 2.0 +- 📊 Built-in monitoring and performance metrics +- 🔍 Comprehensive error handling and debugging +- 🚦 Automated token management and renewal +- 👥 Advanced user and group management +- 🔑 Multiple authentication flows support +- 📈 Enterprise-grade scalability + +## 💻 Installation + +To integrate the Keycloak client library into your .NET Core application, simply add the NuGet package: + +```bash +Install-Package Keycloak.NETCore.Client +``` + +## 🚀 Getting Started + +### 📋 Prerequisites + +- ✳️ .NET Core SDK (version 6.0 or later) +- 🖥️ A running Keycloak instance +- 🔑 Client credentials and realm configuration + +### 🔧 Basic Setup + +1. Add the Keycloak client to your services in `Program.cs` or `Startup.cs`: + +```csharp +services.AddKeycloakAuthentication(options => +{ + options.KeycloakBaseUrl = "http://localhost:8080"; + options.RealmAdminCredentials = new KcClientCredentials + { + ClientId = "your-client-id", + ClientSecret = "your-client-secret" + }; +}); +``` + +## 📖 Basic Usage + +Here's a quick example of how to use the library: + +```csharp +// Create Keycloak client +var keycloakClient = new KeycloakClient("http://localhost:8080"); + +// Authenticate +var token = await keycloakClient.Auth.GetClientCredentialsTokenAsync( + "your-realm", + new KcClientCredentials + { + ClientId = "your-client-id", + ClientSecret = "your-client-secret" + }); + +// Use the token for other operations +var users = await keycloakClient.Users.GetAsync( + "your-realm", + token.AccessToken, + new KcUserFilter { MaxResults = 10 }); +``` +## 📄 License + +This project is licensed under the MIT License. diff --git a/README.md b/README.md index 1406546..0982eea 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ To integrate the Keycloak client library into your .NET Core application, simply add the NuGet package: ```bash -Install-Package NETCore.Keycloak +Install-Package Keycloak.NETCore.Client ``` ## 🚀 Getting Started From db0706e504ced34b4ab3317816bcbc3950100565 Mon Sep 17 00:00:00 2001 From: Hasni Mehdi Date: Sat, 15 Feb 2025 19:53:02 +0100 Subject: [PATCH 2/4] :rocket: Deploy v1.0.1 --- NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj b/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj index f6c144d..30fb8e4 100644 --- a/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj +++ b/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj @@ -5,7 +5,7 @@ A comprehensive .NET Core client library for Keycloak that provides seamless integration with Keycloak's authentication and authorization services. This library offers a robust implementation of Keycloak's REST API, including support for OpenID Connect, OAuth 2.0, and User-Managed Access (UMA 2.0). - 1.0.0 + 1.0.1 Keycloak.NETCore.Client keycloak;oauth2;authentication;authorization;openid-connect;oidc;oidc-provider;fapi;fapi-client;user-managed-access;financial-security black_cockpit.png From 832f992bf963b3938d8860d58fafa8bbf9ecd25d Mon Sep 17 00:00:00 2001 From: Hasni Mehdi Date: Sat, 15 Feb 2025 19:55:48 +0100 Subject: [PATCH 3/4] :100: Fixed project badges --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0982eea..da4cc26 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,8 @@
[![GitHub Build Status](https://github.com/Black-Cockpit/NETCore.Keycloak/actions/workflows/build.yml/badge.svg)](https://github.com/Black-Cockpit/NETCore.Keycloak/actions/workflows/build.yml) -[![NuGet version](https://img.shields.io/nuget/v/NETCore.Keycloak.Client.svg)](https://www.nuget.org/packages/NETCore.Keycloak.Client/) -[![NuGet downloads](https://img.shields.io/nuget/dt/NETCore.Keycloak.Client.svg)](https://www.nuget.org/packages/NETCore.Keycloak.Client/) +[![NuGet version](https://img.shields.io/nuget/v/Keycloak.NETCore.Client.svg)](https://www.nuget.org/packages/Keycloak.NETCore.Client/) +[![NuGet downloads](https://img.shields.io/nuget/dt/Keycloak.NETCore.Client.svg)](https://www.nuget.org/packages/Keycloak.NETCore.Client/) [![GitHub Stars](https://img.shields.io/github/stars/Black-Cockpit/NETCore.Keycloak)](https://github.com/Black-Cockpit/NETCore.Keycloak/stargazers) [![License](https://img.shields.io/github/license/Black-Cockpit/NETCore.Keycloak)](LICENSE) From bff557f361bc07bb6a6c183004eb1bf742dc1d0c Mon Sep 17 00:00:00 2001 From: Hasni Mehdi Date: Sat, 15 Feb 2025 19:56:38 +0100 Subject: [PATCH 4/4] :100: Removed depricated tags --- NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj b/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj index 30fb8e4..c3bf7cb 100644 --- a/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj +++ b/NETCore.Keycloak.Client/NETCore.Keycloak.Client.csproj @@ -9,7 +9,6 @@ Keycloak.NETCore.Client keycloak;oauth2;authentication;authorization;openid-connect;oidc;oidc-provider;fapi;fapi-client;user-managed-access;financial-security black_cockpit.png - https://raw.githubusercontent.com/Black-Cockpit/NETCore.Keycloak/refs/heads/master/LICENSE MIT https://github.com/Black-Cockpit/NETCore.Keycloak.git git