Skip to content

Commit 8e676ee

Browse files
authored
fixes issues causing failure of creation of OAuth application (#2708)
1 parent 64a5e25 commit 8e676ee

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

okta/services/idaas/resource_okta_app_oauth.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -514,8 +514,18 @@ func resourceAppOAuthCreate(ctx context.Context, d *schema.ResourceData, meta in
514514

515515
func setAppOauthGroupsClaim(ctx context.Context, d *schema.ResourceData, meta interface{}) error {
516516
raw, ok := d.GetOk("groups_claim")
517+
// Log deprecation warning
518+
logger(meta).Warn("groups_claim is deprecated and will be removed in a future version. Please use Authorization Server Claims (okta_auth_server_claim) or app profile configuration instead.")
519+
520+
c := meta.(*config.Config)
521+
if c.IsOAuth20Auth() {
522+
logger(meta).Warn("setting groups_claim disabled with OAuth 2.0 API authentication")
523+
return nil
524+
}
525+
517526
apiSupplement := getAPISupplementFromMetadata(meta)
518527
appID := d.Id()
528+
519529
if !ok {
520530
gc := &sdk.AppOauthGroupClaim{
521531
Name: "",
@@ -539,15 +549,6 @@ func setAppOauthGroupsClaim(ctx context.Context, d *schema.ResourceData, meta in
539549
return nil
540550
}
541551

542-
// Log deprecation warning
543-
logger(meta).Warn("groups_claim is deprecated and will be removed in a future version. Please use Authorization Server Claims (okta_auth_server_claim) or app profile configuration instead.")
544-
545-
c := meta.(*config.Config)
546-
if c.IsOAuth20Auth() {
547-
logger(meta).Warn("setting groups_claim disabled with OAuth 2.0 API authentication")
548-
return nil
549-
}
550-
551552
// For now, keep the old behavior but with warnings
552553
// TODO: Remove in future version - functionality temporarily maintained for backward compatibility
553554

0 commit comments

Comments
 (0)