Skip to content

Commit 11b8a66

Browse files
authored
fix: allow use of custom client authenticator types (#845)
1 parent a7e53aa commit 11b8a66

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

docs/resources/openid_client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ resource "keycloak_openid_client" "openid_client" {
5353
URIs for security. This client should be used for applications using the Implicit grant flow.
5454
- `BEARER-ONLY` - Used for services that never initiate a login. This client will only allow bearer token requests.
5555
- `client_secret` - (Optional) The secret for clients with an `access_type` of `CONFIDENTIAL` or `BEARER-ONLY`. This value is sensitive and should be treated with the same care as a password. If omitted, this will be generated by Keycloak.
56-
- `client_authenticator_type` - (Optional) Defaults to `client-secret` The authenticator type for clients with an `access_type` of `CONFIDENTIAL` or `BEARER-ONLY`. Can be one of the following:
56+
- `client_authenticator_type` - (Optional) Defaults to `client-secret`. The authenticator type for clients with an `access_type` of `CONFIDENTIAL` or `BEARER-ONLY`. A default Keycloak installation will have the following available types:
5757
- `client-secret` (Default) Use client id and client secret to authenticate client.
5858
- `client-jwt` Use signed JWT to authenticate client. Set signing algorithm in `extra_config` with `attributes.token.endpoint.auth.signing.alg = <alg>`
5959
- `client-x509` Use x509 certificate to authenticate client. Set Subject DN in `extra_config` with `attributes.x509.subjectdn = <subjectDn>`

provider/resource_keycloak_openid_client.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ var (
2222
keycloakOpenidClientAuthorizationPolicyEnforcementMode = []string{"ENFORCING", "PERMISSIVE", "DISABLED"}
2323
keycloakOpenidClientResourcePermissionDecisionStrategies = []string{"UNANIMOUS", "AFFIRMATIVE", "CONSENSUS"}
2424
keycloakOpenidClientPkceCodeChallengeMethod = []string{"", "plain", "S256"}
25-
keycloakOpenidClientAuthenticatorTypes = []string{"client-secret", "client-jwt", "client-x509", "client-secret-jwt"}
2625
)
2726

2827
func resourceKeycloakOpenidClient() *schema.Resource {
@@ -72,10 +71,10 @@ func resourceKeycloakOpenidClient() *schema.Resource {
7271
Sensitive: true,
7372
},
7473
"client_authenticator_type": {
75-
Type: schema.TypeString,
76-
Optional: true,
77-
ValidateFunc: validation.StringInSlice(keycloakOpenidClientAuthenticatorTypes, false),
78-
Default: "client-secret",
74+
Type: schema.TypeString,
75+
Optional: true,
76+
// No validation is performed since Keycloak plugins can register custom client authenticators
77+
Default: "client-secret",
7978
},
8079
"standard_flow_enabled": {
8180
Type: schema.TypeBool,

0 commit comments

Comments
 (0)