Hello,
Is there a way to import client Scopes in a realm ?
Thanks for the help.
Hello,
Is there a way to import client Scopes in a realm ?
Thanks for the help.
Can you provide more detail? The realm import functionality will import Client Scopes if they are present in the realm json file you are importing.
I have added scope the way it is mentioned in the image above. If I am doing it wrong, please let know.
Thank you for your reply.
That looks right. However, are you doing it manually? Why not just create a realm in the admin UI, create and map the Client Scopes, and then export the realm?
https://www.keycloak.org/docs-api/13.0/rest-api/index.html#_clientscoperepresentation
Actually I have to use import functionality because I have created different realms but client scopes in all of them are same. So instead of creating it every time I thought to import it.
However, can you elaborate on your point: Why not just create a realm in the admin UI, create and map the Client Scopes, and then export the realm?
There is a section of the Admin UI called “Export”, where you can export the realm. Check “Export clients” when you are exporting, so that it will include Clients and Client Scopes:
I totally got the export feature.
Now, for example:
I have 2 realms: one is “demo” and another is “demo1”. I created a scope “sample-scope” in demo realm using the section of the Admin UI called “Client Scopes”. And now I want the same client scope in realm “demo1”. So I exported realm json files of both the realms and then I copied the “sample-scope” curl data from “demo” realm json file and pasted in “demo1” realm json file. Now I imported the demo1 realm json file but the scope was not imported.
Is it the proper way ?
That should work. Do you see any errors in the Keycloak logs?
No, there are no errors. File gets imported successfully.
While importing I only get three options which are mentioned in the image attached below:
as divya mentioned above, I have same issue, that the configurations of client-scopes exported in json could not be imported in realm.
Is there any update on this? I have a fairly complex client scope that I’d like to import into each realm, but the import does not import it. No errors in my logs.
I have no issues exporting the client scope from my template realm.