Skip to content
This repository has been archived by the owner on Jun 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #324 from articulate/feature/mappings
Browse files Browse the repository at this point in the history
okta_profile_mapping resource
  • Loading branch information
quantumew authored Nov 13, 2019
2 parents 03a60eb + 92f3056 commit 1f9fb48
Show file tree
Hide file tree
Showing 9 changed files with 617 additions and 0 deletions.
40 changes: 40 additions & 0 deletions examples/okta_profile_mapping/basic.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
resource okta_profile_mapping test {
source_id = "${okta_idp_social.google.id}"
delete_when_absent = true

mappings {
id = "firstName"
expression = "appuser.firstName"
}

mappings {
id = "lastName"
expression = "appuser.lastName"
}

mappings {
id = "email"
expression = "appuser.email"
}

mappings {
id = "login"
expression = "appuser.email"
}
}

resource okta_idp_social google {
type = "GOOGLE"
protocol_type = "OAUTH2"
name = "testAcc_google_replace_with_uuid"

scopes = [
"profile",
"email",
"openid",
]

client_id = "abcd123"
client_secret = "abcd123"
username_template = "idpuser.email"
}
65 changes: 65 additions & 0 deletions examples/okta_profile_mapping/prevent_delete.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
resource okta_profile_mapping test {
source_id = "${okta_idp_social.google.id}"
delete_when_absent = false

mappings {
id = "firstName"
expression = "appuser.firstName"
}

mappings {
id = "lastName"
expression = "appuser.lastName"
}

mappings {
id = "profileUrl"
expression = "appuser.profileUrl"
}

mappings {
id = "email"
expression = "appuser.email"
}

mappings {
id = "login"
expression = "appuser.email"
}

mappings {
id = "honorificPrefix"
expression = "appuser.honorificPrefix"
}

mappings {
id = "honorificSuffix"
expression = "appuser.honorificSuffix"
}

mappings {
id = "middleName"
expression = "appuser.middleName"
}

mappings {
id = "displayName"
expression = "appuser.displayName"
}
}

resource okta_idp_social google {
type = "GOOGLE"
protocol_type = "OAUTH2"
name = "testAcc_google_replace_with_uuid"

scopes = [
"profile",
"email",
"openid",
]

client_id = "abcd123"
client_secret = "abcd123"
username_template = "idpuser.email"
}
45 changes: 45 additions & 0 deletions examples/okta_profile_mapping/updated.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
resource okta_profile_mapping test {
source_id = "${okta_idp_social.google.id}"
delete_when_absent = true

mappings {
id = "firstName"
expression = "appuser.firstName"
}

mappings {
id = "lastName"
expression = "appuser.lastName"
}

mappings {
id = "profileUrl"
expression = "appuser.profileUrl"
}

mappings {
id = "email"
expression = "appuser.email"
}

mappings {
id = "login"
expression = "appuser.email"
}
}

resource okta_idp_social google {
type = "GOOGLE"
protocol_type = "OAUTH2"
name = "testAcc_google_replace_with_uuid"

scopes = [
"profile",
"email",
"openid",
]

client_id = "abcd123"
client_secret = "abcd123"
username_template = "idpuser.email"
}
2 changes: 2 additions & 0 deletions okta/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const (
inlineHook = "okta_inline_hook"
networkZone = "okta_network_zone"
oktaGroup = "okta_group"
oktaProfileMapping = "okta_profile_mapping"
oktaUser = "okta_user"
policyMfa = "okta_policy_mfa"
policyPassword = "okta_policy_password"
Expand Down Expand Up @@ -143,6 +144,7 @@ func Provider() terraform.ResourceProvider {
inlineHook: resourceInlineHook(),
networkZone: resourceNetworkZone(),
oktaGroup: resourceGroup(),
oktaProfileMapping: resourceOktaProfileMapping(),
oktaUser: resourceUser(),
policyMfa: resourcePolicyMfa(),
policyPassword: resourcePolicyPassword(),
Expand Down
Loading

0 comments on commit 1f9fb48

Please sign in to comment.