How to add a rule to a custom policy in authorization server API

I want to do this: https://developer.okta.com/docs/guides/customize-authz-server/-/create-rules-for-policy/
using an API call from my NodeJS app. Essentially, attaching a rule to a policy in the custom authorization server that allows a group of users to use it.

Can someone tell me if it is possible? If yes, please send links or example of an API call.

Thank you a ton!

  • John

POST to endpoint:

{{oktaOrgUrl}}/api/v1/authorizationServers{{authz id}}/policies/{{policy id}}/rules

https://developer.okta.com/docs/reference/api/authorization-servers/#rule-object

Have you been able to successfully implement this?
I am creating a basic rule with only required fields as a test. I am getting a 500 Internal Server error.

Any ideas?

If you have it implemented, can you plz share your request body?

Any help is much appreciated!

{
“type”: “RESOURCE_ACCESS”,
“status”: “ACTIVE”,
“name”: “default”,
“priority”: 1,
“conditions”: {
“people”: {
“users”: {
“include”: [],
“exclude”: []
},
“groups”: {
“include”: [
“EVERYONE”
],
“exclude”: []
}
},
“grantTypes”: {
“include”: [
“implicit”,
“authorization_code”
]
},
“scopes”: {
“include”: [
“openid”,
“profile”,
“email”,
“address”,
“phone”,
“offline_access”
]
}
},
“actions”: {
“token”: {
“accessTokenLifetimeMinutes”: 120,
“refreshTokenLifetimeMinutes”: 0,
“refreshTokenWindowMinutes”: 1080
}
},
}

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.