Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Noan/add pkce idps #1667

Merged
merged 10 commits into from Jun 13, 2022
3 changes: 3 additions & 0 deletions .changelog/1652.txt
@@ -0,0 +1,3 @@
```release-note:enhancement
jacobbednarz marked this conversation as resolved.
Show resolved Hide resolved
resource/cloudflare_access_identity_provider: Add support for PKCE when creating IDPS.
```
3 changes: 2 additions & 1 deletion docs/resources/cloudflare_access_identity_provider.md
Expand Up @@ -72,7 +72,8 @@ The following arguments are supported:
- `type` - (Required) The provider type to use. Must be one of: `"centrify"`,
`"facebook"`, `"google-apps"`, `"oidc"`, `"github"`, `"google"`, `"saml"`,
`"linkedin"`, `"azureAD"`, `"okta"`, `"onetimepin"`, `"onelogin"`, `"yandex"`.
- `config` - (Optional) Provider configuration from the [developer documentation][access_identity_provider_guide].
* `config` - (Optional) Provider configuration from the [developer documentation][access_identity_provider_guide].
* `pkce_enabled` - (Optional) Enable Proof Key for Code Exchange (PKCE). Only use this if your identity provider supports PKCE for confidential clients.
jacobbednarz marked this conversation as resolved.
Show resolved Hide resolved

## Attributes Reference

Expand Down
Expand Up @@ -207,6 +207,7 @@ func convertSchemaToStruct(d *schema.ResourceData) (cloudflare.AccessIdentityPro
IDPConfig.SsoTargetURL = d.Get("config.0.sso_target_url").(string)
IDPConfig.SupportGroups = d.Get("config.0.support_groups").(bool)
IDPConfig.TokenURL = d.Get("config.0.token_url").(string)
IDPConfig.PKCEEnabled = cloudflare.BoolPtr(d.Get("config.0.pkce_enabled").(bool))
}

return IDPConfig, nil
Expand Down Expand Up @@ -243,6 +244,7 @@ func convertStructToSchema(d *schema.ResourceData, options cloudflare.AccessIden
"sso_target_url": options.SsoTargetURL,
"support_groups": options.SupportGroups,
"token_url": options.TokenURL,
"pkce_enabled": options.PKCEEnabled,
}

return []interface{}{m}
Expand Down
Expand Up @@ -132,6 +132,10 @@ func resourceCloudflareAccessIdentityProviderSchema() map[string]*schema.Schema
Type: schema.TypeString,
Optional: true,
},
"pkce_enabled": {
jacobbednarz marked this conversation as resolved.
Show resolved Hide resolved
Type: schema.TypeBool,
Optional: true,
},
},
},
},
Expand Down