Skip to content

Releases: SamhammerAG/Samhammer.Authentication

10.0.0

Choose a tag to compare

@khoanguyen102 khoanguyen102 released this 15 Jan 07:56
c58172d

Update library to support .NET 10

Breaking Changes

Updates Duende.AccessTokenManagement from v3 to v4 (3.2.0 to 4.1.0)
https://docs.duendesoftware.com/accesstokenmanagement/upgrading/atm-v3-to-v4/
https://github.com/DuendeSoftware/foss/releases/tag/atm-4.0.0

Migration Guide

HowTo update Samhammer.Authentication.Client to use Duende v4
https://docs.duendesoftware.com/accesstokenmanagement/workers/#tab-panel-231 <- migrate clients to use typed values
https://docs.duendesoftware.com/accesstokenmanagement/advanced/client-credentials/#token-caching <- migrate to hybrid cache

NOTES to HybridCache
If you have any IDistributedCache instance e.g. for redis it will automatically be used.
So be aware that accesstokens are saved on this remote cache! You may want to add encryption for the cache.
https://docs.duendesoftware.com/accesstokenmanagement/advanced/client-credentials/#encrypting-cache-entries

//V3
builder.Services.AddDistributedMemoryCache();
builder.Services.AddClientCredentialsTokenManagement();

builder.Services.AddClientCredentialsOptions<ApiAuthOptions>(ApiAuthOptions.DefaultClientName, (client, authOptions) =>
{
    client.TokenEndpoint = authOptions.AccessTokenUrl;
    client.ClientId = authOptions.ClientId;
    client.ClientSecret = authOptions.ClientSecret;
});

builder.Services
    .AddHttpClient(ApiAuthOptions.DefaultClientName)
    .AddClientCredentialsTokenHandler(ApiAuthOptions.DefaultClientName);
//V4
builder.Services.AddClientCredentialsTokenManagement(); //adds also HybridCache if not added yet

builder.Services.AddClientCredentialsOptions<ApiAuthOptions>(ApiAuthOptions.DefaultClientName, (client, authOptions) =>
{
    client.TokenEndpoint = new Uri(authOptions.AccessTokenUrl);
    client.ClientId = ClientId.Parse(authOptions.ClientId);
    client.ClientSecret = ClientSecret.Parse(authOptions.ClientSecret);
});

builder.Services
    .AddHttpClient(ApiAuthOptions.DefaultClientName)
    .AddClientCredentialsTokenHandler(ClientCredentialsClientName.Parse(ApiAuthOptions.DefaultClientName));

8.1.0

Choose a tag to compare

@khoanguyen102 khoanguyen102 released this 11 Mar 07:21
856685a

Bump Duende.AccessTokenManagement from 2.1.0 to 3.2.0.

8.0.0

Choose a tag to compare

@devRoemer devRoemer released this 08 Mar 08:48
1668683
  • Dotnet8

6.1.2

Choose a tag to compare

@agentschmitt agentschmitt released this 14 Apr 13:56

Samhammer.Authentication.Abstractions

  • added options for client authentication to ApiAuthOptions , which can be used for AddClientCredentialsOptions of Samhammer.Authentication.Client

6.1.1

Choose a tag to compare

@datlam162 datlam162 released this 10 Apr 02:05

Minor fixing for stylecop

6.1.0

Choose a tag to compare

@datlam162 datlam162 released this 10 Apr 02:04

Breaking changes:

  • Samhammer.Authentication.Client:
  1. Replaced IdentityModel.AccessTokenManagement by Duende.AccessTokenManagement
  2. AddWithOptionMonitor was replaced by AddClientCredentialsOptions which also support OptionMonitor together with Duende.AccessTokenManagement library

6.0.2

Choose a tag to compare

@agentschmitt agentschmitt released this 03 Apr 08:21
  • Add Samhammer.Authentication.Client
    • extension method AddWithOptionsMonitor

6.0.1

Choose a tag to compare

@ckittelmann ckittelmann released this 16 May 12:29
4a5ec46

Breaking Change:
We changed default behaviour with this tag. Now the "preferred_username" from keycloak is used to set name claim.

To keep the format of 6.0.0 the property "NameClaim" needs to be set to "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name".

6.0.0

Choose a tag to compare

@agentschmitt agentschmitt released this 20 Jan 13:50
ee11ced
  • update for dotnet 6.0
  • added Newtonsoft.Json 13.0 as its no longer included by Microsoft package references
  • change Loglevel for GuestAuthentication #3

Breaking Change:
Due to some changes in dotnet 6.0 the name claim is already set and preferred_username will not be set in name claim

1.2.2

Choose a tag to compare

@devRoemer devRoemer released this 12 Jan 11:15
a15ef35
  • Bumped Microsoft.AspNetCore.Authentication.JwtBearer to version 3.1.22