https://pulumi.com logo
#python
Title
# python
m

mysterious-area-77666

03/24/2023, 1:00 PM
I am working with the Python keycloack provider and am looking for some guidance on the
password_policy
key https://www.pulumi.com/registry/packages/keycloak/api-docs/realm/#password_policy_python and its allowed/accepted values. For example, the keycloak server has an password policy in the UI
Not Recently Used
. If I want to use that value in password_policy, should it be
notRecentlyUsed(3)
? I looked through the keycloak docs search for anything under
PasswordPolicy
but didn’t come across that value https://www.keycloak.org/docs-api/21.0.1/javadocs/index-all.html Would greatly appreciate it if someone has any functional examples around that bit.
e

echoing-dinner-19531

03/25/2023, 3:49 PM
Surprisingly this seems to be completely undocumented by keycloak! It looks like the simplest way to do this is to edit things in the keycloak console, then use the rest api to see what the console set the value to (
GET <KEYCLOAK_HOST>/auth/admin/realms/<YOUR_REALM>
) and then copy that to your program.
m

mysterious-area-77666

03/25/2023, 3:52 PM
Yeah or u can export the entire realm config and search for the right keyword. More layers of abstraction, more places to search, and the less u find 🙂
2 Views