From 4381e802e8ee908cb5574bafb7fb35a6a01e185f Mon Sep 17 00:00:00 2001 From: Jake Zarobsky Date: Tue, 15 Nov 2022 10:32:04 -0500 Subject: [PATCH] Add authentication policy to bookmark app closes #1352 --- okta/resource_okta_app_bookmark.go | 13 +++++++++++++ website/docs/r/app_bookmark.html.markdown | 2 ++ 2 files changed, 15 insertions(+) diff --git a/okta/resource_okta_app_bookmark.go b/okta/resource_okta_app_bookmark.go index f826d0c08..8c075a533 100644 --- a/okta/resource_okta_app_bookmark.go +++ b/okta/resource_okta_app_bookmark.go @@ -32,6 +32,11 @@ func resourceAppBookmark() *schema.Resource { Default: false, Optional: true, }, + "authentication_policy": { + Type: schema.TypeString, + Optional: true, + Description: "Id of this apps authentication policy", + } }), Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(1 * time.Hour), @@ -59,6 +64,10 @@ func resourceAppBookmarkCreate(ctx context.Context, d *schema.ResourceData, m in if err != nil { return diag.Errorf("failed to upload logo for bookmark application: %v", err) } + err = setAuthenticationPolicy(ctx, d, m, app.id) + if err != nil { + return diag.Errorf("failed to set authentication policy for bookmark application: %v", err) + } return resourceAppBookmarkRead(ctx, d, m) } @@ -106,6 +115,10 @@ func resourceAppBookmarkUpdate(ctx context.Context, d *schema.ResourceData, m in return diag.Errorf("failed to upload logo for bookmark application: %v", err) } } + err = setAuthenticationPolicy(ctx, d, m, app.Id) + if err != nil { + return diag.Errorf("failed to set authentication policy for bookmark application: %v", err) + } return resourceAppBookmarkRead(ctx, d, m) } diff --git a/website/docs/r/app_bookmark.html.markdown b/website/docs/r/app_bookmark.html.markdown index 26cf3554b..747f55b0a 100644 --- a/website/docs/r/app_bookmark.html.markdown +++ b/website/docs/r/app_bookmark.html.markdown @@ -33,6 +33,8 @@ The following arguments are supported: - `app_links_json` - (Optional) Displays specific appLinks for the app. The value for each application link should be boolean. +- `authentication_policy` - (Optional) The ID of the associated `app_signon_policy`. If this property is removed from the application the `default` sign-on-policy will be associated with this application. + - `auto_submit_toolbar` - (Optional) Display auto submit toolbar. - `enduser_note` - (Optional) Application notes for end users.