terraform-provider-okta icon indicating copy to clipboard operation
terraform-provider-okta copied to clipboard

Cannot edit access policy rule

Open ahmei0 opened this issue 3 years ago • 23 comments

I'm using following code to create access policy rule, it is created fine but I cannot edit it on UI. When I edit it and click on "Update Rule" it just hangs there and does nothing.

On the other hand, if I create exact a ditto copy of rule using UI, it works fine.

Please advise what terraform is doing differently that causes this problem

resource "okta_auth_server_policy_rule" "ast_auth_server_policy_rule" {
  auth_server_id       = okta_auth_server.ast-auth-server.id
  policy_id            = okta_auth_server_policy.ast_auth_server_policy.id
  status               = "ACTIVE"
  name                 = "${local.app_name_perfix}-policy-rule"
  priority             = 1
  grant_type_whitelist = ["client_credentials", "authorization_code", "password"]
  scope_whitelist      = ["openid", "profile", "email", "AST"]
  group_whitelist      = [okta_group.ASTUsers.id]
}

ahmei0 avatar Oct 15 '21 01:10 ahmei0

@ahmei0 I will look into this further.

monde avatar Oct 15 '21 17:10 monde

@ahmei0 does the account that you log into the UI with have less privileges than superadmin associated with the API token the Okta provider is using? Double check that for me, that will give me next steps for bug escalation.

monde avatar Oct 15 '21 17:10 monde

No, both are superadmin


From: Mike Mondragon @.> Sent: Saturday, October 16, 2021 4:54:00 AM To: okta/terraform-provider-okta @.> Cc: Ahmed, Ishtiaq @.>; Mention @.> Subject: Re: [okta/terraform-provider-okta] Cannot edit access policy rule (#713)

@ahmei0https://github.com/ahmei0 does the account that you log into the UI with have less privileges than superadmin associated with the API token the Okta provider is using? Double check that for me, that will give me next steps for bug escalation.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/okta/terraform-provider-okta/issues/713#issuecomment-944488023, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AO2Y7QHJ2B323PARZS2Y4X3UHBTDRANCNFSM5GA4IPIA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

The content of this email is confidential and intended for the recipient only. Any unauthorised use, disclosure, copying or distribution is strictly prohibited and may be unlawful. If you have received this message in error, confidentiality is not waived and you must not disclose or use the information in it. Please reply to this message and delete it from your system. Our Privacy Policy available at alintaenergy.com.au/privacy tells you how we handle your personal information, including how you can access it, have it corrected, or make a complaint. Please do not print this email unless it is necessary. Every unprinted email helps the environment.

We have moved! The Alinta Melbourne office has moved and is now located at Lvl 16, HWT Tower – 40 City Road, SOUTHBANK, VIC 3006

ahmei0 avatar Oct 15 '21 21:10 ahmei0

@ahmei0 could you check if "AST" scope exists in your Auth Server? Also, you can check the console to see what request UI is making when you heat the Edit sign.

bogdanprodan-okta avatar Oct 18 '21 19:10 bogdanprodan-okta

yes AST scope exist

ahmei0 avatar Oct 18 '21 21:10 ahmei0

Quoting the reply from the team who maintain this functionality :

I've never encountered something like this before. You should see if there are any errors 
in the console log or if any network requests are failing

bogdanprodan-okta avatar Oct 18 '21 21:10 bogdanprodan-okta

Here's the rules config I pulled using postman if that helps. 'backup_rule_ast' was created manually and works fine. retail-digital-ast-ec-nat-uat-policy-rule was created using tf and it has edit issue

[
    {
        "id": "0prx75efaYBTYjYek3l6",
        "status": "ACTIVE",
        "name": "retail-digital-ast-ec-nat-uat-policy-rule",
        "priority": 1,
        "created": null,
        "lastUpdated": null,
        "system": false,
        "conditions": {
            "people": {
                "users": {
                    "exclude": []
                },
                "groups": {
                    "include": [
                        "00gx76jencRKTvlHA3l6"
                    ]
                }
            },
            "grantTypes": {
                "include": [
                    "password",
                    "client_credentials",
                    "authorization_code"
                ]
            },
            "scopes": {
                "include": [
                    "openid",
                    "profile",
                    "email",
                    "AST"
                ]
            }
        },
        "actions": {
            "token": {
                "accessTokenLifetimeMinutes": 60,
                "refreshTokenLifetimeMinutes": 0,
                "refreshTokenWindowMinutes": 10080
            }
        },
        "_links": {
            "self": {
                "href": "https://xxxx-uat.okta.com/api/v1/authorizationServers/xxx/policies/xxx/rules/xxx",
                "hints": {
                    "allow": [
                        "GET",
                        "PUT",
                        "DELETE"
                    ]
                }
            },
            "deactivate": {
                "href": "https://xxxx-uat.okta.com/api/v1/authorizationServers/xxx/policies/xx/rules/xx/lifecycle/deactivate",
                "hints": {
                    "allow": [
                        "POST"
                    ]
                }
            }
        },
        "type": "RESOURCE_ACCESS"
    },
    {
        "id": "0prxte2b4cnA1qrgb3l6",
        "status": "ACTIVE",
        "name": "backup_rule_ast",
        "priority": 2,
        "created": null,
        "lastUpdated": null,
        "system": false,
        "conditions": {
            "people": {
                "users": {
                    "include": [],
                    "exclude": []
                },
                "groups": {
                    "include": [
                        "00gx76jencRKTvlHA3l6"
                    ],
                    "exclude": []
                }
            },
            "grantTypes": {
                "include": [
                    "client_credentials",
                    "password",
                    "authorization_code"
                ]
            },
            "scopes": {
                "include": [
                    "openid",
                    "profile",
                    "email",
                    "AST"
                ]
            }
        },
        "actions": {
            "token": {
                "accessTokenLifetimeMinutes": 60,
                "refreshTokenLifetimeMinutes": 0,
                "refreshTokenWindowMinutes": 10080
            }
        },
        "_links": {
            "self": {
                "href": "https://xxxx-uat.okta.com/api/v1/authorizationServers/xx/policies/xx/rules/xx",
                "hints": {
                    "allow": [
                        "GET",
                        "PUT",
                        "DELETE"
                    ]
                }
            },
            "deactivate": {
                "href": "https://xxx-uat.okta.com/api/v1/authorizationServers/xx/policies/xx/rules/xx/lifecycle/deactivate",
                "hints": {
                    "allow": [
                        "POST"
                    ]
                }
            }
        },
        "type": "RESOURCE_ACCESS"
    }
]

ahmei0 avatar Oct 18 '21 21:10 ahmei0

this is what I see in browser when I press Update Rule image

ahmei0 avatar Oct 18 '21 21:10 ahmei0

Could not load content for webpack://AuthorizationServer/./src/models/ResourceAccessRule.js (HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME)

ahmei0 avatar Oct 18 '21 21:10 ahmei0

Any update on this

ahmei0 avatar Oct 21 '21 23:10 ahmei0

Hi @ahmei0! The team responsible for this functionality is aware of the problem. I'll keep you posted once they give me some updates.

bogdanprodan-okta avatar Oct 22 '21 13:10 bogdanprodan-okta

Were they able to reproduce it?


From: bogdanprodan-okta @.> Sent: Saturday, October 23, 2021 12:11:33 AM To: okta/terraform-provider-okta @.> Cc: Ahmed, Ishtiaq @.>; Mention @.> Subject: Re: [okta/terraform-provider-okta] Cannot edit access policy rule (#713)

Hi @ahmei0https://github.com/ahmei0! The team responsible for this functionality is aware of the problem. I'll keep you posted once they give me some updates.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/okta/terraform-provider-okta/issues/713#issuecomment-949618427, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AO2Y7QHVSFOUHS6PQA67SKTUIFPILANCNFSM5GA4IPIA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

The content of this email is confidential and intended for the recipient only. Any unauthorised use, disclosure, copying or distribution is strictly prohibited and may be unlawful. If you have received this message in error, confidentiality is not waived and you must not disclose or use the information in it. Please reply to this message and delete it from your system. Our Privacy Policy available at alintaenergy.com.au/privacy tells you how we handle your personal information, including how you can access it, have it corrected, or make a complaint. Please do not print this email unless it is necessary. Every unprinted email helps the environment.

We have moved! The Alinta Melbourne office has moved and is now located at Lvl 16, HWT Tower – 40 City Road, SOUTHBANK, VIC 3006

ahmei0 avatar Oct 22 '21 23:10 ahmei0

Internal ticket reference OKTA-441274

bogdanprodan-okta avatar Oct 27 '21 16:10 bogdanprodan-okta

@ahmei0 I've managed to reproduce this bug. It's clearly some UI issue and the team responsible for this functionality will check it. I'll keep you posted.

bogdanprodan-okta avatar Oct 27 '21 18:10 bogdanprodan-okta

I too faced the same issue, the issue seems to exist only when the group_whitelist is set to any groups other than "EVERYONE"

BalaGanaparthi avatar Nov 29 '21 17:11 BalaGanaparthi

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Jan 29 '22 00:01 github-actions[bot]

OKTA-441274 is still on the backlog of the responsible internal team.

monde avatar Feb 02 '22 21:02 monde

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Apr 04 '22 00:04 github-actions[bot]

Still on the backlog of the Okta feature team responsible for this bug.

monde avatar Apr 06 '22 18:04 monde

OKTA-441274 is still on the backlog of the responsible internal team.

monde avatar May 06 '22 16:05 monde

OKTA-441274 is still on the backlog of the responsible internal team. Trying to escalate this internally with a team dependency.

monde avatar Jun 27 '22 17:06 monde

"bug(s) with resources having a priority setting" #1198

monde avatar Jul 09 '22 17:07 monde

Dropping this example for the upcoming v3.34.0 release that demonstrates how to chain resources (that will now have proper concurrency coordination) using the depends_on meta argument so that the Okta service will respect the desired priority assignments.

data "okta_group" "all" {
  name = "Everyone"
}
resource "okta_auth_server" "test" {
  name        = "testAcc_replace_with_uuid"
  description = "test"
  audiences   = ["whatever.rise.zone"]
}
resource "okta_auth_server_policy" "test" {
  name             = "test"
  description      = "test"
  priority         = 1
  client_whitelist = ["ALL_CLIENTS"]
  auth_server_id   = okta_auth_server.test.id
}

resource "okta_auth_server_policy_rule" "test_00" {
  auth_server_id       = okta_auth_server.test.id
  policy_id            = okta_auth_server_policy.test.id
  status               = "ACTIVE"
  name                 = "Test Policy Rule 00"
  priority             = 1 
  group_whitelist      = [data.okta_group.all.id]
  grant_type_whitelist = ["implicit"]
  
}
resource "okta_auth_server_policy_rule" "test_01" {
  auth_server_id       = okta_auth_server.test.id
  policy_id            = okta_auth_server_policy.test.id
  status               = "ACTIVE"
  name                 = "Test Policy Rule 01"
  priority             = 2 
  group_whitelist      = [data.okta_group.all.id]
  grant_type_whitelist = ["implicit"]
  depends_on = [okta_auth_server_policy_rule.test_00]
}
resource "okta_auth_server_policy_rule" "test_02" {
  auth_server_id       = okta_auth_server.test.id
  policy_id            = okta_auth_server_policy.test.id
  status               = "ACTIVE"
  name                 = "Test Policy Rule 02"
  priority             = 3 
  group_whitelist      = [data.okta_group.all.id]
  grant_type_whitelist = ["implicit"]
  depends_on = [okta_auth_server_policy_rule.test_01]
}
resource "okta_auth_server_policy_rule" "test_03" {
  auth_server_id       = okta_auth_server.test.id
  policy_id            = okta_auth_server_policy.test.id
  status               = "ACTIVE"
  name                 = "Test Policy Rule 03"
  priority             = 4 
  group_whitelist      = [data.okta_group.all.id]
  grant_type_whitelist = ["implicit"]
  depends_on = [okta_auth_server_policy_rule.test_02]
}
resource "okta_auth_server_policy_rule" "test_04" {
  auth_server_id       = okta_auth_server.test.id
  policy_id            = okta_auth_server_policy.test.id
  status               = "ACTIVE"
  name                 = "Test Policy Rule 04"
  priority             = 5 
  group_whitelist      = [data.okta_group.all.id]
  grant_type_whitelist = ["implicit"]
  depends_on = [okta_auth_server_policy_rule.test_03]
}
resource "okta_auth_server_policy_rule" "test_05" {
  auth_server_id       = okta_auth_server.test.id
  policy_id            = okta_auth_server_policy.test.id
  status               = "ACTIVE"
  name                 = "Test Policy Rule 05"
  priority             = 6 
  group_whitelist      = [data.okta_group.all.id]
  grant_type_whitelist = ["implicit"]
  depends_on = [okta_auth_server_policy_rule.test_04]
}
resource "okta_auth_server_policy_rule" "test_06" {
  auth_server_id       = okta_auth_server.test.id
  policy_id            = okta_auth_server_policy.test.id
  status               = "ACTIVE"
  name                 = "Test Policy Rule 06"
  priority             = 7 
  group_whitelist      = [data.okta_group.all.id]
  grant_type_whitelist = ["implicit"]
  depends_on = [okta_auth_server_policy_rule.test_05]
}
resource "okta_auth_server_policy_rule" "test_07" {
  auth_server_id       = okta_auth_server.test.id
  policy_id            = okta_auth_server_policy.test.id
  status               = "ACTIVE"
  name                 = "Test Policy Rule 07"
  priority             = 8 
  group_whitelist      = [data.okta_group.all.id]
  grant_type_whitelist = ["implicit"]
  depends_on = [okta_auth_server_policy_rule.test_06]
}
resource "okta_auth_server_policy_rule" "test_08" {
  auth_server_id       = okta_auth_server.test.id
  policy_id            = okta_auth_server_policy.test.id
  status               = "ACTIVE"
  name                 = "Test Policy Rule 08"
  priority             = 9 
  group_whitelist      = [data.okta_group.all.id]
  grant_type_whitelist = ["implicit"]
  depends_on = [okta_auth_server_policy_rule.test_07]
}
resource "okta_auth_server_policy_rule" "test_09" {
  auth_server_id       = okta_auth_server.test.id
  policy_id            = okta_auth_server_policy.test.id
  status               = "ACTIVE"
  name                 = "Test Policy Rule 09"
  priority             = 10 
  group_whitelist      = [data.okta_group.all.id]
  grant_type_whitelist = ["implicit"]
  depends_on = [okta_auth_server_policy_rule.test_08]
}

monde avatar Aug 11 '22 22:08 monde

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] avatar Jan 27 '23 00:01 github-actions[bot]