Redirecting user to another site during recovery flow #5989
-
I have an expression already built that identifies users from a particular authentication source. When this expression comes back as true, is it possible to redirect that user to another website? During the password recovery flow, I want those users to go back to the original authentication source to perform their password reset. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I was ultimately able to accomplish this with a policy expression, but it also required that "Evaluate when stage is run" was enabled in the stage that the policy is associated with. Here is the policy expression that I used: plan = request.context.get("flow_plan")
pendingUser = ak_user_by(username=context['pending_user'].username)
distinguishedName = pendingUser.attributes.get("distinguishedName")
if plan and distinguishedName and regex_match(distinguishedName, ".*cn=users,dc=xxx,dc=xxx$"):
plan.redirect("https://[password reset URL]")
return False
else:
return True |
Beta Was this translation helpful? Give feedback.
I was ultimately able to accomplish this with a policy expression, but it also required that "Evaluate when stage is run" was enabled in the stage that the policy is associated with.
Here is the policy expression that I used: