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

Add Webhooks to healthcare terraform #209

Open
bhanchand opened this issue Jul 2, 2020 · 2 comments
Open

Add Webhooks to healthcare terraform #209

bhanchand opened this issue Jul 2, 2020 · 2 comments
Assignees
Labels
needs-review Needs further review question Further information is requested

Comments

@bhanchand
Copy link
Contributor

Describe the bug
Terraform scripts missing provisioning for inline hooks
Currently this is being deployed manually

@bhanchand bhanchand self-assigned this Jul 2, 2020
@noinarisak noinarisak added question Further information is requested needs-investigation Needs further investigation labels Jul 13, 2020
@noinarisak
Copy link
Contributor

Pointing out that UDP will now have to support external rest API? Not sure if want to responsible for other UDP services.

Could be better as instructions, author the HCL script, and have it committed out, IMO.

@noinarisak noinarisak added needs-review Needs further review and removed needs-investigation Needs further investigation labels Jul 16, 2020
@noinarisak
Copy link
Contributor

noinarisak commented Jul 17, 2020

This the following HCL script that @bhanchand is having issues with.

variable "org_name" {}
variable "api_token" {}
variable "base_url" {}
variable "demo_app_name" {}
variable "udp_subdomain" {}

locals {
    app_domain = "${var.udp_subdomain}.${var.demo_app_name}.unidemo.info"
    nodash_subdomain = replace(var.udp_subdomain, "-", "_")
}

provider "okta" {
  org_name  = var.org_name
  api_token = var.api_token
  base_url  = var.base_url

  # Update default backoff
  # min_wait_seconds = 60
  # max_wait_seconds = 600
  # max_retries      = 10

  version = "~> 3.0"
}
resource "okta_inline_hook" "healthcare" {
  name        = "${var.udp_subdomain}${var.demo_app_name}_inline_webhook"
  version     = "1.0.1"
  type        = "com.okta.oauth2.tokens.transform"
  status      = "ACTIVE"
  channel     = {
                  type    = "HTTP"
                  version = "1.0.0"
                  uri     = "https://scim.glitch.me/eventhook"
                  method  = "POST"
  }
  auth        = {
                  key   = "x-api-key"
                  type  = "HEADER"
                  value = "abcDEF"
  }
}

resource "okta_auth_server" "healthcare" {
  name        = "${var.udp_subdomain} ${var.demo_app_name}"
  description = "Generated by UDP"
  audiences   = ["api://${local.app_domain}"]
}

resource "okta_auth_server_policy" "healthcare" {
  auth_server_id   = okta_auth_server.healthcare.id
  status           = "ACTIVE"
  name             = "standard"
  description      = "Generated by UDP"
  priority         = 1
  client_whitelist = ["${okta_app_oauth.healthcare.id}"]
}

resource "okta_auth_server_policy_rule" "healthcare" {
  auth_server_id       = okta_auth_server.healthcare.id
  policy_id            = okta_auth_server_policy.healthcare.id
  status               = "ACTIVE"
  name                 = "one_hour"
  priority             = 1
  group_whitelist      = ["${data.okta_group.all.id}"]
  grant_type_whitelist = ["authorization_code"]
  scope_whitelist      = ["*"]
}

resource "okta_auth_server_policy_rule" "healthcare" {
  auth_server_id       = "${okta_auth_server.healthcare.id}"
  policy_id            = "${okta_auth_server_policy.healthcare.id}"
  status               = "ACTIVE"
  name                 = "one_hour"
  priority             = 1
  group_whitelist      = ["${data.okta_group.all.id}"]
  grant_type_whitelist = ["authorization_code"]
  scope_whitelist      = ["*"]
  inline_hook_id       = "${okta_inline_hook.healthcare.id}"
}

@mdwallick mdwallick assigned mdwallick and unassigned bhanchand Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-review Needs further review question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants