/Keycloak.Net

C# client for Keycloak 6.x

Primary LanguageC#MIT LicenseMIT

Icon

Keycloak.Net.Core

license NuGet downloads

Improvements

  • add AuthenticationRealmName to the KeycloakOptions
  • add missing fields to the Credentials
  • fix GetUserConsentsAsync
  • add DeleteUserCredentialAsync
  • implement refresh token

ORIGINAL README

Maintainer wanted, i don't use the library any more, if you are willing to take over please start a discussion or issue

A Fork of https://github.com/lvermeulen/Keycloak.Net with some additional patches

  • allow usage of CancellationTokens
  • changed ClientConfig to Dictionary<string, string>
  • removed signing
  • .net 6 support only
  • updated for keycloak version 17+
  • added support for changing default AdminClientId which has default admin-cli value

To use different AdminClientId, use newly introduced KeyCloakOptions:

new KeycloakClient(
  "http://keycloak.url",
  "adminUserName",
  "adminPassword",
  new KeycloakOptions(adminClientId:"admin"
  )
);

Older version support for using /auth path

When creating a new KeycloakClient, use newly introduced KeycloakOptions:

new KeycloakClient(
   "http://keycloak.url",
   "adminUserName",
   "adminPassword",
   new KeycloakOptions(prefix:"auth"
   )
);

C# client for Keycloak 6.x

See documentation at https://www.keycloak.org/docs-api/6.0/rest-api/

Features

  • Attack Detection
  • Authentication Management
  • Client Attribute Certificate
  • Client Initial Access
  • Client Registration Policy
  • Client Role Mappings
  • Client Scopes
  • Clients
  • Component
  • Groups
  • Identity Providers
  • Key
  • Protocol Mappers
  • Realms Admin
  • Role Mapper
  • Roles
  • Roles (by ID)
  • Scope Mappings
  • User Storage Provider
  • Users
  • Root