okta / terraform-provider-okta

A Terraform provider to manage Okta resources, enabling infrastructure-as-code provisioning and management of users, groups, applications, and other Okta objects.
https://registry.terraform.io/providers/okta/okta
Mozilla Public License 2.0
250 stars 204 forks source link

Add IdP username RegEx filter to okta_idp_oidc #2035

Open Marek26 opened 1 month ago

Marek26 commented 1 month ago

Community Note

Description

Currently the filter for specific username patterns (Filter below IdP username on UI; policy.subject.filter in the API) can not be maintained via terraform. Please include this in the terraform resource.

New or Affected Resource(s)

Potential Terraform Configuration

resource "okta_idp_oidc" "example" {
  name                  = "example"
  authorization_url     = "https://idp.example.com/authorize"
  authorization_binding = "HTTP-REDIRECT"
  token_url             = "https://idp.example.com/token"
  token_binding         = "HTTP-POST"
  user_info_url         = "https://idp.example.com/userinfo"
  user_info_binding     = "HTTP-REDIRECT"
  jwks_url              = "https://idp.example.com/keys"
  jwks_binding          = "HTTP-REDIRECT"
  scopes                = ["openid"]
  client_id             = "efg456"
  client_secret         = "efg456"
  issuer_url            = "https://id.example.com"
  username_template     = "idpuser.email"
  subject_filter        = "^@(?i)domain.com$"
  subject_match_type    = "USERNAME"
}

References

duytiennguyen-okta commented 1 month ago

@Marek26 Can you show me how to do this in the UI?

Marek26 commented 1 month ago

@duytiennguyen-okta:

image

duytiennguyen-okta commented 1 month ago

OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-749111