Is it possible to get a hold of redirect state parameter within a rule?

I need to redirect to an external service on login, but I don’t fully control the other end. In the rule that I write I would like to get the state parameter and put it into my signed JWT as part of a return url. According to the documentation neither rules nor actions can access that state parameter. Because the param is generated after the rules/action executes.
Are there any workarounds for this scenario that would help avoid writing a dedicated backend for it?

In other words, in the rule code:

  context.redirect = {
    url: "https://example.com/foo" // ?state=<state> will be added here, how to get this value in the rule?
  };

Hey there!

As we’re getting closer to Rules & Hooks full deprecation maybe you’re interested in learning how to achieve that with Actions?

As this topic is related to Rules - Hooks - Actions, I’m excited to let you know about our next Ask me Anything session in the Forum on Thursday, January 18 with the Rules, Hooks and Actions team on Rules & Hooks and why Actions matter! Submit your questions in the thread above and our esteemed product experts will provide written answers on January 18. Find out more about Rules & Hooks and why Actions matter! Can’t wait to see you there!

Learn more here!