-
Notifications
You must be signed in to change notification settings - Fork 619
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
Support custom claims in cloudflare_access_identity_provider (OIDC) config #1440
Comments
i'm not sure if this is supported by the Access service itself but it is definitely not supported in cloudflare-go. i would recommend starting with a support ticket to have this included as a feature and then it can be added downstream before here. |
So, this definitely appears to be supported by Access, based on the API docs and the example API configuration. This also seems to to be a single-line addition to type AccessIdentityProviderConfiguration struct {
APIToken string `json:"api_token,omitempty"`
// ...
+ Scopes string `json:"scopes,omitempty"`
} (Copied from L18-45 in func convertSchemaToStruct(d *schema.ResourceData) (cloudflare.AccessIdentityProviderConfiguration, error) {
// ...
IDPConfig.PKCEEnabled = cloudflare.BoolPtr(d.Get("config.0.pkce_enabled").(bool))
// I know that `scopes` is supposed to be a list(string), but it's been ages since
// I've used Go, so I'm not sure how this ought to be written.
+ IDPConfig.Scopes = cloudflare.ListPtr(d.Get("config.0.scopes").(string))
}
return IDPConfig, nil
} and func convertStructToSchema(d *schema.ResourceData, options cloudflare.AccessIdentityProviderConfiguration) []interface{} {
// ...
"pkce_enabled": options.PKCEEnabled,
+ "scopes": options.Scopes,
}
return []interface{}{m}
} I pulled the last two examples from here: terraform-provider-cloudflare/internal/sdkv2provider/resource_cloudflare_access_identity_provider.go Lines 187 to 259 in 7b9490a
|
This seems to be resolved in cloudflare/cloudflare-go#1237, which seems slated for |
Current Terraform and Cloudflare provider version
Terraform v0.14.9
Description
Feature request for supporting
custom claims
forcloudflare_access_identity_provider
resource with the typeOIDC
. This is supported by the Cloudflare generic OIDC identity provider and can't be configured using terraform.Sample identity provider configuration returned by Cloudflare API which contains custom claims.
Use cases
"cloudflare_access_identity_provider" should have the ability to accept custom claims supported by any given IDP with OIDC protocol. Those claims are passed down to Cloudflare via Token ID and we should have the flexibility to decide which claims should be included in the JWT token generated by Cloudflare.
The ideal configuration would be as follows,
Potential Terraform configuration
References
No response
The text was updated successfully, but these errors were encountered: