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

Commit

Permalink
Fixes #287
Browse files Browse the repository at this point in the history
  • Loading branch information
quantumew committed Oct 15, 2019
1 parent d618538 commit 9068e10
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,3 +218,9 @@ ENHANCEMENTS:
BUG FIXES:

* Remove resource from state on 404. [GH-269]

## 3.0.29

BUG FIXES:

* Ensure we safely sync auth server properties. [GH-299]
1 change: 1 addition & 0 deletions examples/okta_auth_server/dependency.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ resource okta_auth_server test {
resource okta_auth_server test1 {
name = "testAcc_replace_with_uuid1"
audiences = ["api://selfservice_client_2"]
credentials_rotation_mode = "MANUAL"
}
10 changes: 10 additions & 0 deletions okta/resource_okta_auth_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,23 @@ func buildAuthServer(d *schema.ResourceData) *sdk.AuthorizationServer {

func resourceAuthServerCreate(d *schema.ResourceData, m interface{}) error {
authServer := buildAuthServer(d)

responseAuthServer, _, err := getSupplementFromMetadata(m).CreateAuthorizationServer(*authServer, nil)
if err != nil {
return err
}

d.SetId(responseAuthServer.Id)

if d.Get("credentials_rotation_mode").(string) == "MANUAL" {
// Auth servers can only be set to manual on update. No clue why.
err = resourceAuthServerUpdate(d, m)

if err != nil {
return err
}
}

return resourceAuthServerRead(d, m)
}

Expand Down
2 changes: 1 addition & 1 deletion okta/resource_okta_auth_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func TestAccOktaAuthServer_gh299(t *testing.T) {

resource.TestCheckResourceAttr(resource2Name, "name", name+"1"),
resource.TestCheckResourceAttr(resource2Name, "audiences.#", "1"),
resource.TestCheckResourceAttr(resource2Name, "credentials_rotation_mode", "AUTO"),
resource.TestCheckResourceAttr(resource2Name, "credentials_rotation_mode", "MANUAL"),
),
},
},
Expand Down

0 comments on commit 9068e10

Please sign in to comment.