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 #262 from articulate/feature/hide-oauth-app
Browse files Browse the repository at this point in the history
OAuth App Visibility Settings
  • Loading branch information
quantumew authored Aug 27, 2019
2 parents 1c80c7b + f024e43 commit db58a12
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 6 deletions.
15 changes: 9 additions & 6 deletions examples/okta_app_oauth/updated.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
resource "okta_app_oauth" "test" {
label = "testAcc_replace_with_uuid"
status = "INACTIVE"
type = "browser"
grant_types = ["implicit"]
redirect_uris = ["http://d.com/aaa"]
response_types = ["token", "id_token"]
label = "testAcc_replace_with_uuid"
status = "INACTIVE"
type = "browser"
grant_types = ["implicit"]
redirect_uris = ["http://d.com/aaa"]
response_types = ["token", "id_token"]
hide_ios = true
hide_web = true
auto_submit_toolbar = false
}
1 change: 1 addition & 0 deletions okta/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func buildVisibility(d *schema.ResourceData) *okta.ApplicationVisibility {
autoSubmit := d.Get("auto_submit_toolbar").(bool)
hideMobile := d.Get("hide_ios").(bool)
hideWeb := d.Get("hide_web").(bool)

return &okta.ApplicationVisibility{
AutoSubmitToolbar: &autoSubmit,
Hide: &okta.ApplicationVisibilityHide{
Expand Down
22 changes: 22 additions & 0 deletions okta/resource_app_oauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,24 @@ func resourceAppOAuth() *schema.Resource {
Default: "ORG_URL",
Description: "*Early Access Property*. Indicates whether the Okta Authorization Server uses the original Okta org domain URL or a custom domain URL as the issuer of ID token for this client.",
},
"auto_submit_toolbar": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Display auto submit toolbar",
},
"hide_ios": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Default: true,
Description: "Do not display application icon on mobile app",
},
"hide_web": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Default: true,
Description: "Do not display application icon to users",
},
}),
}
}
Expand Down Expand Up @@ -291,6 +309,9 @@ func resourceAppOAuthRead(d *schema.ResourceData, m interface{}) error {
d.Set("tos_uri", app.Settings.OauthClient.TosUri)
d.Set("policy_uri", app.Settings.OauthClient.PolicyUri)
d.Set("login_uri", app.Settings.OauthClient.InitiateLoginUri)
d.Set("auto_submit_toolbar", app.Visibility.AutoSubmitToolbar)
d.Set("hide_ios", app.Visibility.Hide.IOS)
d.Set("hide_web", app.Visibility.Hide.Web)

if app.Settings.OauthClient.IssuerMode != "" {
d.Set("issuer_mode", app.Settings.OauthClient.IssuerMode)
Expand Down Expand Up @@ -419,6 +440,7 @@ func buildAppOAuth(d *schema.ResourceData, m interface{}) *okta.OpenIdConnectApp
IssuerMode: d.Get("issuer_mode").(string),
},
}
app.Visibility = buildVisibility(d)

return app
}
6 changes: 6 additions & 0 deletions okta/resource_app_oauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ func TestAccAppOauth_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "status", "ACTIVE"),
resource.TestCheckResourceAttr(resourceName, "type", "web"),
resource.TestCheckResourceAttr(resourceName, "grant_types.#", "1"),
resource.TestCheckResourceAttr(resourceName, "hide_ios", "true"),
resource.TestCheckResourceAttr(resourceName, "hide_web", "true"),
resource.TestCheckResourceAttr(resourceName, "auto_submit_toolbar", "false"),
resource.TestCheckResourceAttr(resourceName, "redirect_uris.#", "1"),
resource.TestCheckResourceAttr(resourceName, "response_types.#", "1"),
resource.TestCheckResourceAttr(resourceName, "client_secret", "something_from_somewhere"),
Expand All @@ -46,6 +49,9 @@ func TestAccAppOauth_basic(t *testing.T) {
resource.TestCheckResourceAttr(resourceName, "label", buildResourceName(ri)),
resource.TestCheckResourceAttr(resourceName, "status", "INACTIVE"),
resource.TestCheckResourceAttr(resourceName, "type", "browser"),
resource.TestCheckResourceAttr(resourceName, "hide_ios", "true"),
resource.TestCheckResourceAttr(resourceName, "hide_web", "true"),
resource.TestCheckResourceAttr(resourceName, "auto_submit_toolbar", "false"),
resource.TestCheckResourceAttr(resourceName, "grant_types.#", "1"),
resource.TestCheckResourceAttrSet(resourceName, "client_secret"),
resource.TestCheckResourceAttrSet(resourceName, "client_id"),
Expand Down

0 comments on commit db58a12

Please sign in to comment.