-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresource.tf
More file actions
144 lines (122 loc) · 3.74 KB
/
resource.tf
File metadata and controls
144 lines (122 loc) · 3.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# Google Sign-In
resource "ory_social_provider" "google" {
provider_id = "google"
provider_type = "google"
client_id = var.google_client_id
client_secret = var.google_client_secret
scope = ["email", "profile"]
}
# Generic OIDC with a custom base redirect URI (e.g., when using a custom domain)
resource "ory_social_provider" "corporate_sso_custom_domain" {
provider_id = "corporate-sso-custom-domain"
provider_type = "generic"
client_id = var.sso_client_id
client_secret = var.sso_client_secret
issuer_url = "https://sso.example.com"
scope = ["openid", "profile", "email"]
base_redirect_uri = "https://iam.example.com"
}
# GitHub
resource "ory_social_provider" "github" {
provider_id = "github"
provider_type = "github"
client_id = var.github_client_id
client_secret = var.github_client_secret
scope = ["user:email", "read:user"]
}
# Microsoft Azure AD
resource "ory_social_provider" "microsoft" {
provider_id = "microsoft"
provider_type = "microsoft"
client_id = var.azure_client_id
client_secret = var.azure_client_secret
tenant = var.azure_tenant_id # or "common" for multi-tenant
scope = ["openid", "profile", "email"]
}
# Apple Sign-In (using Apple-specific credentials)
resource "ory_social_provider" "apple" {
provider_id = "apple"
provider_type = "apple"
client_id = var.apple_service_id
apple_team_id = var.apple_team_id
apple_private_key_id = var.apple_private_key_id
apple_private_key = var.apple_private_key
scope = ["email", "name"]
}
# Generic OIDC Provider with custom claims mapping
resource "ory_social_provider" "corporate_sso" {
provider_id = "corporate-sso"
provider_type = "generic"
client_id = var.sso_client_id
client_secret = var.sso_client_secret
issuer_url = "https://sso.example.com"
scope = ["openid", "profile", "email"]
# Jsonnet mapper for custom claims mapping (base64-encoded)
mapper_url = "base64://bG9jYWwgY2xhaW1zID0gc3RkLmV4dFZhcignY2xhaW1zJyk7CnsKICBpZGVudGl0eTogewogICAgdHJhaXRzOiB7CiAgICAgIGVtYWlsOiBjbGFpbXMuZW1haWwsCiAgICB9LAogIH0sCn0="
}
# Generic OIDC with custom authorization and token URLs
resource "ory_social_provider" "custom_provider" {
provider_id = "custom-idp"
provider_type = "generic"
client_id = var.custom_client_id
client_secret = var.custom_client_secret
issuer_url = "https://idp.example.com"
auth_url = "https://idp.example.com/custom/authorize"
token_url = "https://idp.example.com/custom/token"
scope = ["openid", "email"]
}
variable "google_client_id" {
type = string
}
variable "google_client_secret" {
type = string
sensitive = true
}
variable "github_client_id" {
type = string
}
variable "github_client_secret" {
type = string
sensitive = true
}
variable "azure_client_id" {
type = string
}
variable "azure_client_secret" {
type = string
sensitive = true
}
variable "azure_tenant_id" {
type = string
}
variable "apple_service_id" {
description = "Apple Service ID (e.g., com.example.auth)"
type = string
}
variable "apple_team_id" {
description = "Apple Developer Team ID"
type = string
}
variable "apple_private_key_id" {
description = "Apple private key ID from the Developer portal"
type = string
}
variable "apple_private_key" {
description = "Apple private key in PEM format (.p8 file contents)"
type = string
sensitive = true
}
variable "sso_client_id" {
type = string
}
variable "sso_client_secret" {
type = string
sensitive = true
}
variable "custom_client_id" {
type = string
}
variable "custom_client_secret" {
type = string
sensitive = true
}