Closed aqib-bhat closed 7 months ago
@aqib-bhat Thanks for bringing this to our attention! I've entered an internal issue for tracking; this will need to be prioritized against other work.
Internal Ref: OKTA-533711
@bryanapellanes-okta Do we have a status on this? Do we have a cleaner way to create Routing rules in 7.0.5?
Fixed in 7.0.6
Describe the bug?
What the goal was
The problem we ran into
IPolicyRuleActions
using theIdpPolicyRuleActionProvider
constructor, setting theId
property gives the error: "A property without setter or inaccessible setter cannot be assigned to".Type
property has both a getter and a setter defined.Type = "OKTA"
, the call toIPolicy
>.CreateRuleAsync(routingRule, cancellationToken);
will work but if we want to set Type = "SAML2", we have to also set theId
but that is not being allowed.The workaround
IOktaClient
>.PostAsync<PolicyRule>(request: new HttpRequest { ...
call to create the routing rule in the default IdP Discovery Policy.IPolicyRule
payload to add the Okta Idp Id you wish to pass.DefaultSerializer
from the OktaSDK as recommended in https://github.com/okta/okta-sdk-dotnet#json-serialization.actions.idp.providers
to be an array with the only element having"type" : "SAML2"
and"id"
equal to you Okta Idp Id.IIdpPolicyRuleActionProvider
andIdpPolicyRuleActionProvider
to have the setter for theId
property, and then everything worked smoothly as well.What is expected to happen?
Id
property ofIdpPolicyRuleActionProvider
.IPolicy
object for the default IdP Discovery Policy, calling its method.CreateRuleAsync(routingRule, cancellationToken);
is successful and creating the routing rule whose action is to use our IdP (whose ID we supplied).What is the actual behavior?
When creating the object of type
IPolicyRuleActions
using theIdpPolicyRuleActionProvider
constructor, setting theId
property gives the error:Reproduction Steps?
IPolicyRuleActions
using theIdpPolicyRuleActionProvider
constructor, try to set theId
property.Type = "SAML2"
.Additional Information?
No response
.NET Version
6
SDK Version
5.6.0
OS version
Windows 10