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 #257 from articulate/bugfix/disable-auto-provisioning
Browse files Browse the repository at this point in the history
Allow disabling of auto provisioning on IdPs
  • Loading branch information
quantumew authored Aug 22, 2019
2 parents ae0413b + 7fadc7c commit ffed78e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
16 changes: 16 additions & 0 deletions examples/okta_idp_social/auto_provision_disabled.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
resource okta_idp_social google {
type = "GOOGLE"
protocol_type = "OAUTH2"
name = "testAcc_google_replace_with_uuid"
provisioning_action = "DISABLED"

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

client_id = "abcd123"
client_secret = "abcd123"
username_template = "idpuser.email"
}
2 changes: 1 addition & 1 deletion okta/idp.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ var (
"provisioning_action": &schema.Schema{
Type: schema.TypeString,
Optional: true,
ValidateFunc: validation.StringInSlice([]string{"AUTO", ""}, false),
ValidateFunc: validation.StringInSlice([]string{"AUTO", "DISABLED", ""}, false),
Default: "AUTO",
},
"deprovisioned_action": actionSchema,
Expand Down
13 changes: 13 additions & 0 deletions okta/resource_idp_social_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func TestAccIdpSocial(t *testing.T) {
ri := acctest.RandInt()
mgr := newFixtureManager(idpSocial)
config := mgr.GetFixtures("basic.tf", ri, t)
disabledConf := mgr.GetFixtures("auto_provision_disabled.tf", ri, t)
fbName := fmt.Sprintf("%s.facebook", idpSocial)
microName := fmt.Sprintf("%s.microsoft", idpSocial)
googleName := fmt.Sprintf("%s.google", idpSocial)
Expand Down Expand Up @@ -49,6 +50,18 @@ func TestAccIdpSocial(t *testing.T) {
resource.TestCheckResourceAttr(googleName, "username_template", "idpuser.email"),
),
},
{
Config: disabledConf,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(googleName, "type", "GOOGLE"),
resource.TestCheckResourceAttr(googleName, "protocol_type", "OAUTH2"),
resource.TestCheckResourceAttr(googleName, "name", fmt.Sprintf("testAcc_google_%d", ri)),
resource.TestCheckResourceAttr(googleName, "client_id", "abcd123"),
resource.TestCheckResourceAttr(googleName, "client_secret", "abcd123"),
resource.TestCheckResourceAttr(googleName, "username_template", "idpuser.email"),
resource.TestCheckResourceAttr(googleName, "provisioning_action", "DISABLED"),
),
},
},
})
}

0 comments on commit ffed78e

Please # to comment.