diff --git a/examples/okta_app_oauth/updated.tf b/examples/okta_app_oauth/updated.tf index a754af9b..76294a8f 100644 --- a/examples/okta_app_oauth/updated.tf +++ b/examples/okta_app_oauth/updated.tf @@ -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 } diff --git a/okta/app.go b/okta/app.go index 60cc3c48..828c33b8 100644 --- a/okta/app.go +++ b/okta/app.go @@ -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{ diff --git a/okta/resource_app_oauth.go b/okta/resource_app_oauth.go index fa281b3c..74e60fee 100644 --- a/okta/resource_app_oauth.go +++ b/okta/resource_app_oauth.go @@ -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", + }, }), } } @@ -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) @@ -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 } diff --git a/okta/resource_app_oauth_test.go b/okta/resource_app_oauth_test.go index 4825fdea..8cc496c8 100644 --- a/okta/resource_app_oauth_test.go +++ b/okta/resource_app_oauth_test.go @@ -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"), @@ -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"),