Skip to content

Redirecting user to another site during recovery flow #5989

Answered by royaldunlin
royaldunlin asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by royaldunlin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant