Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keycloak Partial Export does not work #147

Open
SamTV12345 opened this issue Dec 27, 2024 · 4 comments · May be fixed by #150
Open

Keycloak Partial Export does not work #147

SamTV12345 opened this issue Dec 27, 2024 · 4 comments · May be fixed by #150

Comments

@SamTV12345
Copy link

I have the issue that I want to create a client that extracts most of the resources from a running Keycloak instance. After I found out that the realm endpoint only returns basic things about a realm I discovered the partial export method for a realm. But somehow it returns an optional string and that string is for me always none. I use the master realm in my export so that should be there always. It's Keycloak v26.0.7

@kilork
Copy link
Owner

kilork commented Dec 27, 2024

The working strategy would be probably to sent same request using curl and see that happens.

@SamTV12345
Copy link
Author

👍 I'll debug this on Monday. Every other request just works only this does not work. Using the admin panel and exporting that there works without an issue. I also checked that it is the same endpoint with the same query parameters.

@kilork
Copy link
Owner

kilork commented Feb 17, 2025

I think it is not stopping us from providing here a better solution. We previously added special case for handling Location header in empty responses (#119). This is why this response type Option<String>. But I think we did this a little bit non transparent. That we should to improve it is to change how threat empty responses. Seems like OpenAPI description generated by keycloak is quite limited, the empty response could be text, or have location header. I will prepare now alternative solution, it will be in branch for some time, as it breaks existing clients.

@kilork kilork linked a pull request Feb 17, 2025 that will close this issue
@kilork
Copy link
Owner

kilork commented Feb 17, 2025

@SamTV12345 you may try #150 now.

Basically code call looks like that:

let partial_export: serde_json::Value = keycloak_admin
        .realm_partial_export_post(&realm, None, None)
        .await?
        .into_response()
        .json()
        .await?;

I could not do the new release at the moment, as it is breaking change, we have to wait next Keycloak release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants