Skip to content

Commit cc2ea56

Browse files
authored
Add files via upload
1 parent a1238c4 commit cc2ea56

File tree

5 files changed

+58
-0
lines changed

5 files changed

+58
-0
lines changed

data.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
data "okta_user" "user" { user_id = var.email }

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
output "app" { value = okta_app_oauth.app }
2+
output "client_id" { value = okta_app_oauth.app.client_id }
3+
output "client_secret" { value = okta_app_oauth.app.client_secret }
4+
output "cookie_secret" { value = random_string.cookie_secret.result }
5+
output "oauth_port" { value = random_integer.port.result }

resources.tf

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
resource "okta_app_oauth" "app" {
2+
label = var.label
3+
type = var.type
4+
grant_types = var.grant_types
5+
login_uri = formatlist("%s/*", var.urls).0
6+
redirect_uris = concat(
7+
var.urls,
8+
formatlist("%s/oauth2/callback", var.urls),
9+
formatlist("%s/*", var.urls)
10+
)
11+
status = var.status
12+
auto_key_rotation = var.key_rotation
13+
logo_uri = var.logo_uri
14+
hide_ios = true
15+
hide_web = true
16+
response_types = var.response_types
17+
token_endpoint_auth_method = var.auth_method
18+
users {
19+
username = data.okta_user.user.email
20+
id = data.okta_user.user.id
21+
}
22+
}
23+
24+
resource "random_string" "cookie_secret" {
25+
length = 32
26+
special = true
27+
}
28+
29+
resource "random_integer" "port" {
30+
max = 50000
31+
min = 20000
32+
}

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
variable "auth_method" { default = "client_secret_post" }
2+
variable "domain" { type = string }
3+
variable "email" { type = string }
4+
variable "grant_types" { default = ["authorization_code", "implicit"] }
5+
variable "key_rotation" { default = true }
6+
variable "label" { type = string }
7+
variable "logo_uri" { default = "" }
8+
variable "name" { type = string }
9+
variable "response_types" { default = ["code", "id_token"] }
10+
variable "status" { default = "ACTIVE" }
11+
variable "type" { default = "web" }
12+
variable "urls" { type = list(string) }

versions.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
terraform {
2+
required_providers {
3+
okta = {
4+
source = "oktadeveloper/okta"
5+
}
6+
}
7+
}
8+

0 commit comments

Comments
 (0)