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> <ItemGroup>
<ProjectReference Include="..\EShopOnAbp.Shared.Hosting\EShopOnAbp.Shared.Hosting.csproj" /> <ProjectReference Include="..\EShopOnAbp.Shared.Hosting\EShopOnAbp.Shared.Hosting.csproj" />
<!-- <ProjectReference Include="..\..\..\Keycloak.Net\src\Keycloak.Net.Core\Keycloak.Net.Core.csproj" />-->
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

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

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

Loading…
Cancel
Save