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
256 stars 207 forks source link

Add AuthN Policy assignment to Bookmark and SWA app resources #1203

Open sgal-dm opened 2 years ago

sgal-dm commented 2 years ago

Community Note

Description

All application types can be associated with an Authentication Policy, but only the _okta_appsaml and _okta_appoauth resources have the necessary _authenticationpolicy attribute to build that association with Terraform.

Looking at API documentation, it seems like this could be implemented across the board. Can the authentication_policy attribute be added to Bookmark and SWA application resources?

New or Affected Resource(s)

Potential Terraform Configuration

# Retrieve the authentication policy
data "okta_policy" "auth" {
  type  = "ACCESS_POLICY"
  name  = "non-default"
}

resource "okta_app_bookmark" "bookmark" {
  ...
  authentication_policy = data.okta_policy.auth.id
  ...
}

resource "okta_app_swa" "swa" {
  ...
  authentication_policy = data.okta_policy.auth.id
  ...
}

References

tgoodsell-tempus commented 2 years ago

I'm against adding these directly to the resource due to https://github.com/okta/terraform-provider-okta/issues/1202 and the terraform best practices (https://www.terraform.io/plugin/hashicorp-provider-design-principles#resources-should-represent-a-single-api-object).

However, I think creating a standalone "link" resource that works generically for all apps is do able and the better route. I can plan on spending some time making this within the next couple weeks, if I can get my hands on a OIE dev environment.

monde commented 2 years ago

We'll have to prioritize working on this.

monde commented 2 years ago

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

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

sgal-dm commented 1 year ago

Not Stale

gleeblezoid commented 1 year ago

Agreed, not stale, and it'd actually be great to include okta_app_auto_login apps in this too (or I'm happy to raise a separate issue for that - whichever folks prefer).