Releases: SamhammerAG/Samhammer.Authentication
10.0.0
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
Bump Duende.AccessTokenManagement from 2.1.0 to 3.2.0.
8.0.0
6.1.2
Samhammer.Authentication.Abstractions
- added options for client authentication to ApiAuthOptions , which can be used for AddClientCredentialsOptions of Samhammer.Authentication.Client
6.1.1
6.1.0
Breaking changes:
- Samhammer.Authentication.Client:
- Replaced IdentityModel.AccessTokenManagement by Duende.AccessTokenManagement
- AddWithOptionMonitor was replaced by AddClientCredentialsOptions which also support OptionMonitor together with Duende.AccessTokenManagement library
6.0.2
- Add Samhammer.Authentication.Client
- extension method AddWithOptionsMonitor
6.0.1
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".