Migration Guide
Key Changes in 2.0.0
- Breaking change 💥: Lot's of changes
Keycloak.AuthServices.Sdk- API has changed, no backward compatibility. - Breaking change 💥: Removed dependencies on
RefitandIdentityModel.AspNetCore. Tokens are no longer managed by this library and you need to configure it separately. RolesClaimTransformationSourcechanged toNonefromResourceAccessmeaning we no longer map toAspNetCoreroles by default. Renamed toEnableRolesMapping. Moved toKeycloak.AuthServices.Authorization.- Moved
IKeycloakProtectionClienttoKeycloak.AuthServices.Authorizationand renamed it toIAuthorizationServerClient. RemovedAddKeycloakProtectionHttpClient, addedAddAuthorizationServerinstead. Note,IKeycloakProtectionClientis used as umbrella interface for Protection API now. (can be confusing if you used previous versions)
csharp
// Before
.AddKeycloakAuthorization(configuration)
// After
.AddKeycloakAuthorization().AddAuthorizationServer(configuration)- Dropped namespace
Keycloak.AuthServices.Sdk.AuthZ AddKeycloakAuthenticationhas been deprecated in favor ofAddKeycloakWebApiAuthentication.- Breaking change 💥: Changed default Configuration format from kebab-case to PascalCase. See the KeycloakInstallationOptionsTests.cs for more details.
json
{
// new default
"Keycloak1": {
"realm": "Test",
"auth-server-url": "http://localhost:8080/",
"ssl-required": "none",
"resource": "test-client",
"verify-token-audience": true,
"credentials": {
"secret": "secret"
}
},
// old default
"Keycloak2": {
"Realm": "Test",
"AuthServerUrl": "http://localhost:8080/",
"SslRequired": "none",
"Resource": "test-client",
"VerifyTokenAudience": true,
"Credentials": {
"Secret": "secret"
}
}
}