Unable to create client scope
Closed this issue · 1 comments
anne376 commented
I'm trying to create a client scope. The call is successful, but the UI of Keycloak throws an error when I want to display my new client scope.
Error message in UI: "Danger alert:n is undefined Press here to refresh and continue"
It is noticeable that openid-connect value in protocol is displayed incorrectly. For all other items "OpenID Connect" is display, but for my new client scope "openid-connect" is displayed.
The question now is whether I am executing the call incorrectly or whether there is possibly an error.
Has anyone else already had this problem?
Here is my code to create the client scope:
List<ProtocolMapper> protocolMappers = [];
ProtocolMapper mapper = new() { Name = myName, Protocol = "opernid-connect", _ProtocolMapper = "oidc-hardcoded-claim-mapper", ConsentRequired = false };
Dictionary<string, string> mapperConfig = new()
{
{ "access.token.claim", "true" },
{ "claim.name", myName},
{ "claim.value", myId},
{ "id.token.claim", "true"},
{ "userinfo.token.claim", "true"},
{ "access.tokenResponse.claim", "false"}
};
mapper.Config = mapperConfig;
protocolMappers.Add(mapper);
clientScope = new()
{
Name = newName,
Protocol = "opernid-connect",
ProtocolMappers = protocolMappers,
};
await KeycloakClient.CreateClientScopeAsync(Realm, clientScope, cancellationToken);
anne376 commented
Issue can be closed. I found my mistake: Protocol = "opernid-connect"
has an r that has crept in