Skip to content

Commit

Permalink
feat: add groups mapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderMatt committed Sep 6, 2023
1 parent 515768f commit 4b70540
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion src/tasks/keycloak/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,24 @@ export const protocolMappersList: Array<Record<string, unknown>> = [
'jsonType.label': 'String',
},
},
{
name: 'groups-mapper',
protocol: 'openid-connect',
protocolMapper: 'oidc-group-membership-mapper',
consentRequired: false,
config: {
multivalued: 'true',
'userinfo.token.claim': 'true',
'id.token.claim': 'true',
'access.token.claim': 'true',
'claim.name': 'groups',
'jsonType.label': 'String',
},
},
{
name: 'email',
protocol: 'openid-connect',
protocolMapper: 'oidc-usermodel-property-mapper',
protocolMapper: 'oidc-usermodel-g-mapper',
consentRequired: false,
config: {
'userinfo.token.claim': 'true',
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/keycloak/keycloak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ async function main(): Promise<void> {
// Create Identity Provider
const idp = await createIdProvider()

const existingProviders = ((await doApiCall(errors, 'Geting identity provider', async () =>
const existingProviders = ((await doApiCall(errors, 'Getting identity provider', async () =>
api.providers.realmIdentityProviderInstancesGet(keycloakRealm),
)) || []) as Array<IdentityProviderRepresentation>

Expand Down

0 comments on commit 4b70540

Please sign in to comment.