Skip to content

Commit

Permalink
update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Laureat Grepi authored and Laureat Grepi committed Sep 3, 2024
1 parent 85784fb commit e6123f2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 17 deletions.
9 changes: 7 additions & 2 deletions docs/resources/required_action.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,13 @@ resource "keycloak_realm" "realm" {
resource "keycloak_required_action" "required_action" {
realm_id = keycloak_realm.realm.realm
alias = "webauthn-register"
alias = "UPDATE_PASSWORD"
enabled = true
name = "Webauthn Register"
name = "Update Password"
config = {
max_auth_age = "600"
}
}
```

Expand All @@ -33,6 +37,7 @@ resource "keycloak_required_action" "required_action" {
- `enabled` - (Optional) When `false`, the required action is not enabled for new users. Defaults to `false`.
- `default_action` - (Optional) When `true`, the required action is set as the default action for new users. Defaults to `false`.
- `priority`- (Optional) The priority of the required action.
- `config`- (Optional) The configuration. Keys are specific to each configurable required action and not checked when applying.

## Import

Expand Down
41 changes: 26 additions & 15 deletions example/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,17 @@ resource "keycloak_required_action" "custom-terms-and-conditions" {
name = "Custom Terms and Conditions"
}

resource "keycloak_required_action" "update-password" {
realm_id = keycloak_realm.test.realm
alias = "UPDATE_PASSWORD"
default_action = true
enabled = true
name = "Update Password"

config {
max_auth_age = "600"
}
}
resource "keycloak_required_action" "custom-configured_totp" {
realm_id = keycloak_realm.test.realm
alias = "CONFIGURE_TOTP"
Expand Down Expand Up @@ -427,25 +438,25 @@ resource "keycloak_ldap_full_name_mapper" "full_name_mapper" {
}

resource "keycloak_ldap_custom_mapper" "custom_mapper" {
name = "custom-mapper"
realm_id = keycloak_ldap_user_federation.openldap.realm_id
ldap_user_federation_id = keycloak_ldap_user_federation.openldap.id
name = "custom-mapper"
realm_id = keycloak_ldap_user_federation.openldap.realm_id
ldap_user_federation_id = keycloak_ldap_user_federation.openldap.id

provider_id = "msad-user-account-control-mapper"
provider_type = "org.keycloak.storage.ldap.mappers.LDAPStorageMapper"
provider_id = "msad-user-account-control-mapper"
provider_type = "org.keycloak.storage.ldap.mappers.LDAPStorageMapper"
}

resource "keycloak_ldap_custom_mapper" "custom_mapper_with_config" {
name = "custom-mapper-with-config"
realm_id = keycloak_ldap_user_federation.openldap.realm_id
ldap_user_federation_id = keycloak_ldap_user_federation.openldap.id

provider_id = "user-attribute-ldap-mapper"
provider_type = "org.keycloak.storage.ldap.mappers.LDAPStorageMapper"
config = {
"user.model.attribute" = "username"
"ldap.attribute" = "cn"
}
name = "custom-mapper-with-config"
realm_id = keycloak_ldap_user_federation.openldap.realm_id
ldap_user_federation_id = keycloak_ldap_user_federation.openldap.id

provider_id = "user-attribute-ldap-mapper"
provider_type = "org.keycloak.storage.ldap.mappers.LDAPStorageMapper"
config = {
"user.model.attribute" = "username"
"ldap.attribute" = "cn"
}
}


Expand Down

0 comments on commit e6123f2

Please sign in to comment.