Open to-ph opened 2 years ago
I should clarify that I'm looking at required actions in the keycloak console through Authentication
-> Required Actions
Hello @to-ph
Thanks for reporting this issue.
you can check the new release of Keycloak and its respective keycloak config cli version that supports it
As an example to see it working with that lates version,
I have a json file with no required actions as such
{
"realm": "realm-one",
"enabled": true,
"clients": [
{
"clientId": "my-client",
"enabled": true,
"clientAuthenticatorType": "client-secret",
"secret": "updated-client-secret",
"redirectUris": ["https://my-updated-client.example.com/*"],
"webOrigins": ["https://my-updated-client.example.com"]
}
],
"roles": {
"realm": [
{
"name": "user",
"description": "Updated user role description"
},
{
"name": "admin",
"description": "Updated admin role description"
}
]
}
}
Now, i am going to update the realm with required actions but their defaultActions will be false.
{
{
"realm": "realm-one",
"enabled": true,
"requiredActions": [
{
"alias": "CONFIGURE_TOTP",
"name": "Configure OTP",
"providerId": "CONFIGURE_TOTP",
"enabled": true,
"defaultAction": false,
"priority": 10,
"config": {}
},
{
"alias": "terms_and_conditions",
"name": "Terms and Conditions",
"providerId": "terms_and_conditions",
"enabled": true,
"defaultAction": false,
"priority": 20,
"config": {}
},
{
"alias": "UPDATE_PASSWORD",
"name": "Update Password",
"providerId": "UPDATE_PASSWORD",
"enabled": false,
"defaultAction": false,
"priority": 30,
"config": {}
},
{
"alias": "UPDATE_PROFILE",
"name": "Update Profile",
"providerId": "UPDATE_PROFILE",
"enabled": true,
"defaultAction": false,
"priority": 40,
"config": {}
}
],
"clients": [
{
"clientId": "my-client",
"enabled": true,
"clientAuthenticatorType": "client-secret",
"secret": "updated-client-secret",
"redirectUris": ["https://my-updated-client.example.com/*"],
"webOrigins": ["https://my-updated-client.example.com"]
}
],
"roles": {
"realm": [
{
"name": "user",
"description": "Updated user role description"
},
{
"name": "admin",
"description": "Updated admin role description"
}
]
}
}
Now we can update the defaultActions to be enabled as such
{
"realm": "realm-one",
"enabled": true,
"requiredActions": [
{
"alias": "CONFIGURE_TOTP",
"name": "Configure OTP",
"providerId": "CONFIGURE_TOTP",
"enabled": true,
"defaultAction": true,
"priority": 10,
"config": {}
},
{
"alias": "terms_and_conditions",
"name": "Terms and Conditions",
"providerId": "terms_and_conditions",
"enabled": true,
"defaultAction": true,
"priority": 20,
"config": {}
},
{
"alias": "UPDATE_PASSWORD",
"name": "Update Password",
"providerId": "UPDATE_PASSWORD",
"enabled": false,
"defaultAction": true,
"priority": 30,
"config": {}
},
{
"alias": "UPDATE_PROFILE",
"name": "Update Profile",
"providerId": "UPDATE_PROFILE",
"enabled": true,
"defaultAction": true,
"priority": 40,
"config": {}
}
],
"clients": [
{
"clientId": "my-client",
"enabled": true,
"clientAuthenticatorType": "client-secret",
"secret": "updated-client-secret",
"redirectUris": ["https://my-updated-client.example.com/*"],
"webOrigins": ["https://my-updated-client.example.com"]
}
],
"roles": {
"realm": [
{
"name": "user",
"description": "Updated user role description"
},
{
"name": "admin",
"description": "Updated admin role description"
}
]
}
}
Current Behavior
When running the cli with
I do not see defaultAction set to
true
in the admin consoleAlso running (as seen from examples):
Does not create the required action (should it?).
Expected Behavior
A Configure OTP required action with
defaultAction
set to true should be created on the keycloak realm.Steps To Reproduce
Environment
Anything else?
Hopefully nothing's obviously wrong on my end. Thanks for the help!