Returning patterns for policy rules with new Okta sdk version 7

we have previously been using the Okta client to retrieve policy rules and iterate over them to get userIdentifier and patterns like this:

var policy = await OktaClient.GetAsync<Policy>($"/api/v1/policies/{policyId}?expand=rules");
var rules = await policy.ListPolicyRules().ToListAsync();

The OktaClient is no longer present in version 7. I found this method instead, but it doesn’t return userIdentifier and patterns as before:

var rules = PolicyApi.ListPolicyRules(policyId);

How can we retrieve the same data as in version 5?

I’ve tried new api clients, but the policy rule in version 7 has far less data than before.

Thank you.

Hello @ryan1969, thank you for your response, but the OktaClient class is removed in the latest version so I can’t use this one right? I don’t get the rule’s patterns in the PolicyApi response.

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