Dosaic.Plugins.Authorization.Keycloak
1.0.34
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Dosaic.Plugins.Authorization.Keycloak --version 1.0.34
NuGet\Install-Package Dosaic.Plugins.Authorization.Keycloak -Version 1.0.34
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Dosaic.Plugins.Authorization.Keycloak" Version="1.0.34" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dosaic.Plugins.Authorization.Keycloak" Version="1.0.34" />
<PackageReference Include="Dosaic.Plugins.Authorization.Keycloak" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Dosaic.Plugins.Authorization.Keycloak --version 1.0.34
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Dosaic.Plugins.Authorization.Keycloak, 1.0.34"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Dosaic.Plugins.Authorization.Keycloak&version=1.0.34
#tool nuget:?package=Dosaic.Plugins.Authorization.Keycloak&version=1.0.34
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Dosaic.Plugins.Authorization.Keycloak
Dosaic.Plugins.Authorization.Keycloak is a plugin
that allows to use authentication polices with an keycloak server instance for authentication & authorization
.
Installation
To install the nuget package follow these steps:
dotnet add package Dosaic.Plugins.Authorization.Keycloak
or add as package reference to your .csproj
<PackageReference Include="Dosaic.Plugins.Authorization.Keycloak" Version="" />
Appsettings.yml
Configure your appsettings.yml with these properties
keycloak:
enabled: true #whenever the whole plugin should be active or not
host: host.example #keycloak host url
insecure: false i used protocol https vs http
realms:
prefix: '/realms/' # url prefix which should be used before the realm
policies: # policies which should be available within the service/application
- name: READ
roles:
- API_PERMISSIONS_READ
- name: WRITE
roles:
- API_PERMISSIONS_WRITE
PluginReadmeTemplateConfig.cs
[Configuration("keycloak")]
public class KeycloakPluginConfiguration
{
public bool Enabled { get; set; }
public string? Host { get; set; }
public bool Insecure { get; set; }
public RealmsConfig Realms { get; set; } = new RealmsConfig();
public IList<AuthPolicy> Policies { get; set; } = new List<AuthPolicy>();
}
public class RealmsConfig
{
public string Prefix { get; set; } = "/auth/realms/";
}
Usage
public class PluginReadme : IPluginEndpointsConfiguration
{
public void ConfigureEndpoints(IEndpointRouteBuilder endpointRouteBuilder, IServiceProvider serviceProvider)
{
endpointRouteBuilder
.AddSimpleRestResource<MyResourceClass>(serviceProvider, "my-resource")
.ForGet(configuration => configuration.WithPolicies("READ")) // assign individual policies for each http verb
.ForGetList(configuration => configuration.WithPolicies("READ"))
.ForDelete(configuration => configuration.WithPolicies("WRITE"))
.ForPost(configuration => configuration.WithPolicies("WRITE"))
.ForPut(configuration => configuration.WithPolicies("WRITE"))
.ForAll(configuration => configuration.WithPolicies("WRITE", "READ")); // or for all at once
endpointRouteBuilder.MapGet("/hello", async () => "Hello World!").RequireAuthorization("READ");
}
}
public class ExampleController : ControllerBase
{
[HttpGet]
[Authorize("READ")]
public IActionResult Hello() => Ok();
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net9.0
- AspNetCore.HealthChecks.Uris (>= 9.0.0)
- BouncyCastle.NetCore (>= 2.2.1)
- Dosaic.Hosting.Abstractions (>= 1.0.34)
- Dosaic.Plugins.Authorization.Abstractions (>= 1.0.34)
- Microsoft.AspNetCore.Authentication.OpenIdConnect (>= 9.0.2)
- Microsoft.IdentityModel.Tokens (>= 8.6.0)
- Newtonsoft.Json (>= 13.0.3)
- System.IdentityModel.Tokens.Jwt (>= 8.6.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.7 | 209 | 6/13/2025 |
1.1.6 | 132 | 6/5/2025 |
1.1.5 | 128 | 6/4/2025 |
1.1.4 | 127 | 6/4/2025 |
1.1.3 | 123 | 5/23/2025 |
1.1.2 | 144 | 5/8/2025 |
1.1.1 | 140 | 5/6/2025 |
1.1.0 | 101 | 5/2/2025 |
1.0.37 | 165 | 4/7/2025 |
1.0.36 | 484 | 3/25/2025 |
1.0.35 | 234 | 3/4/2025 |
1.0.34 | 204 | 3/4/2025 |
1.0.32 | 147 | 3/3/2025 |
1.0.30 | 109 | 1/30/2025 |
1.0.27 | 97 | 1/29/2025 |
1.0.26 | 82 | 1/29/2025 |
1.0.25 | 92 | 1/29/2025 |
1.0.18 | 104 | 1/23/2025 |
1.0.17 | 94 | 1/23/2025 |