@@ -4,10 +4,11 @@ import (
44 "context"
55 "errors"
66 "fmt"
7- "github.com/hashicorp/go-cty/cty"
87 "reflect"
98 "strings"
109
10+ "github.com/hashicorp/go-cty/cty"
11+
1112 "dario.cat/mergo"
1213 "github.com/hashicorp/terraform-plugin-sdk/v2/diag"
1314 "github.com/hashicorp/terraform-plugin-sdk/v2/helper/customdiff"
@@ -283,6 +284,15 @@ func resourceKeycloakOpenidClient() *schema.Resource {
283284 Optional : true ,
284285 Default : false ,
285286 },
287+ "standard_token_exchange_enabled" : {
288+ Type : schema .TypeBool ,
289+ Optional : true ,
290+ Default : false ,
291+ },
292+ "allow_refresh_token_in_standard_token_exchange" : {
293+ Type : schema .TypeString ,
294+ Optional : true ,
295+ },
286296 "frontchannel_logout_url" : {
287297 Type : schema .TypeString ,
288298 Optional : true ,
@@ -382,28 +392,30 @@ func getOpenidClientFromData(data *schema.ResourceData) (*keycloak.OpenidClient,
382392 FrontChannelLogoutEnabled : data .Get ("frontchannel_logout_enabled" ).(bool ),
383393 FullScopeAllowed : data .Get ("full_scope_allowed" ).(bool ),
384394 Attributes : keycloak.OpenidClientAttributes {
385- PkceCodeChallengeMethod : data .Get ("pkce_code_challenge_method" ).(string ),
386- ExcludeSessionStateFromAuthResponse : types .KeycloakBoolQuoted (data .Get ("exclude_session_state_from_auth_response" ).(bool )),
387- ExcludeIssuerFromAuthResponse : types .KeycloakBoolQuoted (data .Get ("exclude_issuer_from_auth_response" ).(bool )),
388- AccessTokenLifespan : data .Get ("access_token_lifespan" ).(string ),
389- LoginTheme : data .Get ("login_theme" ).(string ),
390- ClientOfflineSessionIdleTimeout : data .Get ("client_offline_session_idle_timeout" ).(string ),
391- ClientOfflineSessionMaxLifespan : data .Get ("client_offline_session_max_lifespan" ).(string ),
392- ClientSessionIdleTimeout : data .Get ("client_session_idle_timeout" ).(string ),
393- ClientSessionMaxLifespan : data .Get ("client_session_max_lifespan" ).(string ),
394- UseRefreshTokens : types .KeycloakBoolQuoted (data .Get ("use_refresh_tokens" ).(bool )),
395- UseRefreshTokensClientCredentials : types .KeycloakBoolQuoted (data .Get ("use_refresh_tokens_client_credentials" ).(bool )),
396- FrontchannelLogoutUrl : data .Get ("frontchannel_logout_url" ).(string ),
397- BackchannelLogoutUrl : data .Get ("backchannel_logout_url" ).(string ),
398- BackchannelLogoutRevokeOfflineTokens : types .KeycloakBoolQuoted (data .Get ("backchannel_logout_revoke_offline_sessions" ).(bool )),
399- BackchannelLogoutSessionRequired : types .KeycloakBoolQuoted (data .Get ("backchannel_logout_session_required" ).(bool )),
400- ExtraConfig : getExtraConfigFromData (data ),
401- Oauth2DeviceAuthorizationGrantEnabled : types .KeycloakBoolQuoted (data .Get ("oauth2_device_authorization_grant_enabled" ).(bool )),
402- Oauth2DeviceCodeLifespan : data .Get ("oauth2_device_code_lifespan" ).(string ),
403- Oauth2DevicePollingInterval : data .Get ("oauth2_device_polling_interval" ).(string ),
404- ConsentScreenText : data .Get ("consent_screen_text" ).(string ),
405- DisplayOnConsentScreen : types .KeycloakBoolQuoted (data .Get ("display_on_consent_screen" ).(bool )),
406- PostLogoutRedirectUris : types .KeycloakSliceHashDelimited (validPostLogoutRedirectUris ),
395+ PkceCodeChallengeMethod : data .Get ("pkce_code_challenge_method" ).(string ),
396+ ExcludeSessionStateFromAuthResponse : types .KeycloakBoolQuoted (data .Get ("exclude_session_state_from_auth_response" ).(bool )),
397+ ExcludeIssuerFromAuthResponse : types .KeycloakBoolQuoted (data .Get ("exclude_issuer_from_auth_response" ).(bool )),
398+ AccessTokenLifespan : data .Get ("access_token_lifespan" ).(string ),
399+ LoginTheme : data .Get ("login_theme" ).(string ),
400+ ClientOfflineSessionIdleTimeout : data .Get ("client_offline_session_idle_timeout" ).(string ),
401+ ClientOfflineSessionMaxLifespan : data .Get ("client_offline_session_max_lifespan" ).(string ),
402+ ClientSessionIdleTimeout : data .Get ("client_session_idle_timeout" ).(string ),
403+ ClientSessionMaxLifespan : data .Get ("client_session_max_lifespan" ).(string ),
404+ UseRefreshTokens : types .KeycloakBoolQuoted (data .Get ("use_refresh_tokens" ).(bool )),
405+ UseRefreshTokensClientCredentials : types .KeycloakBoolQuoted (data .Get ("use_refresh_tokens_client_credentials" ).(bool )),
406+ StandardTokenExchangeEnabled : types .KeycloakBoolQuoted (data .Get ("standard_token_exchange_enabled" ).(bool )),
407+ AllowRefreshTokenInStandardTokenExchange : data .Get ("allow_refresh_token_in_standard_token_exchange" ).(string ),
408+ FrontchannelLogoutUrl : data .Get ("frontchannel_logout_url" ).(string ),
409+ BackchannelLogoutUrl : data .Get ("backchannel_logout_url" ).(string ),
410+ BackchannelLogoutRevokeOfflineTokens : types .KeycloakBoolQuoted (data .Get ("backchannel_logout_revoke_offline_sessions" ).(bool )),
411+ BackchannelLogoutSessionRequired : types .KeycloakBoolQuoted (data .Get ("backchannel_logout_session_required" ).(bool )),
412+ ExtraConfig : getExtraConfigFromData (data ),
413+ Oauth2DeviceAuthorizationGrantEnabled : types .KeycloakBoolQuoted (data .Get ("oauth2_device_authorization_grant_enabled" ).(bool )),
414+ Oauth2DeviceCodeLifespan : data .Get ("oauth2_device_code_lifespan" ).(string ),
415+ Oauth2DevicePollingInterval : data .Get ("oauth2_device_polling_interval" ).(string ),
416+ ConsentScreenText : data .Get ("consent_screen_text" ).(string ),
417+ DisplayOnConsentScreen : types .KeycloakBoolQuoted (data .Get ("display_on_consent_screen" ).(bool )),
418+ PostLogoutRedirectUris : types .KeycloakSliceHashDelimited (validPostLogoutRedirectUris ),
407419 },
408420 ValidRedirectUris : validRedirectUris ,
409421 WebOrigins : webOrigins ,
@@ -506,6 +518,8 @@ func setOpenidClientData(ctx context.Context, keycloakClient *keycloak.KeycloakC
506518 data .Set ("login_theme" , client .Attributes .LoginTheme )
507519 data .Set ("use_refresh_tokens" , client .Attributes .UseRefreshTokens )
508520 data .Set ("use_refresh_tokens_client_credentials" , client .Attributes .UseRefreshTokensClientCredentials )
521+ data .Set ("standard_token_exchange_enabled" , client .Attributes .StandardTokenExchangeEnabled )
522+ data .Set ("allow_refresh_token_in_standard_token_exchange" , client .Attributes .AllowRefreshTokenInStandardTokenExchange )
509523 data .Set ("oauth2_device_authorization_grant_enabled" , client .Attributes .Oauth2DeviceAuthorizationGrantEnabled )
510524 data .Set ("oauth2_device_code_lifespan" , client .Attributes .Oauth2DeviceCodeLifespan )
511525 data .Set ("oauth2_device_polling_interval" , client .Attributes .Oauth2DevicePollingInterval )
0 commit comments