Browse Source

Updated keycloak data seeder for current keycloak library

pull/134/head
Galip Tolga Erdem 4 years ago
parent
commit
7817404531
  1. 1
      shared/EShopOnAbp.Keycloak.DbMigrator/EShopOnAbp.Keycloak.DbMigrator.csproj
  2. 20
      shared/EShopOnAbp.Keycloak.DbMigrator/KeycloakDataSeeder.cs

1
shared/EShopOnAbp.Keycloak.DbMigrator/EShopOnAbp.Keycloak.DbMigrator.csproj

@ -13,6 +13,7 @@
<ItemGroup>
<ProjectReference Include="..\EShopOnAbp.Shared.Hosting\EShopOnAbp.Shared.Hosting.csproj" />
<!-- <ProjectReference Include="..\..\..\Keycloak.Net\src\Keycloak.Net.Core\Keycloak.Net.Core.csproj" />-->
</ItemGroup>
<ItemGroup>

20
shared/EShopOnAbp.Keycloak.DbMigrator/KeycloakDataSeeder.cs

@ -78,17 +78,17 @@ public class KeyCloakDataSeeder : IDataSeedContributor, ITransientDependency
Name = scopeName,
Protocol = "openid-connect",
_ProtocolMapper = "oidc-audience-mapper",
Config = new Dictionary<string, string>()
{
{ "id.token.claim", "false" },
{ "access.token.claim", "true" },
{ "included.custom.audience", scopeName }
}
// Config = new Config() // This should be dictionary -> Outdated library
// Config = new Dictionary<string, string>() //TODO: Update when //https://github.com/AnderssonPeter/Keycloak.Net/pull/5 is merged
// {
// AccessTokenClaim = "true",
// IdTokenClaim = "false"
// { "id.token.claim", "false" },
// { "access.token.claim", "true" },
// { "included.custom.audience", scopeName }
// }
Config = new Config() // This should be dictionary -> Outdated library
{
AccessTokenClaim = "true",
IdTokenClaim = "false"
}
}
}
};
@ -132,6 +132,7 @@ public class KeyCloakDataSeeder : IDataSeedContributor, ITransientDependency
};
await _keycloakClient.CreateClientAsync(_keycloakOptions.RealmName, webClient);
//TODO: Update when //https://github.com/AnderssonPeter/Keycloak.Net/pull/5 is merged
// await AddOptionalClientScopesAsync(
// "PublicWeb",
@ -217,6 +218,7 @@ public class KeyCloakDataSeeder : IDataSeedContributor, ITransientDependency
};
await _keycloakClient.CreateClientAsync(_keycloakOptions.RealmName, publicWebClient);
//TODO: Update when //https://github.com/AnderssonPeter/Keycloak.Net/pull/5 is merged
// await AddOptionalClientScopesAsync(
// "PublicWeb",

Loading…
Cancel
Save