Open Page with a POST response

0
Overview: - The user is logged in on website 1, presses a button and goes to website 2. (along with a return url) - On website 2 he can login and select his education diploma’s. He then clicks a button to be brought back to website 1, via the return url. Behind the scenes the user is logged out of website 2, and redirected to website 1 again. - The return url for website 1 is a published REST service that expects POST calls. The diploma’s that the user selected on website 2 are encrypted inside this POST call. - On website 1, i retrieve the POST call, and everything works fine, but i want the user to return to the original page again, where he was in the first step. - Inside the POST call i can identify the user, associate it with the logged in user, sign him in, all in the same microflow. It all works, except open page is not working. The user goes back to website 1 and only sees the published REST url in his url bar of his website, and a completely blank page.   I’ve tried an end & start transaction in the microflow, that didn’t do anything. Another option would be to direct the user to website 2 in a new tab, but he has to manually close this tab then, and still sees the blank page in the end..   Any suggestions?
asked
1 answers
1

Hi Richard,

 

You can redirect the user to a specific page by returning a HTTP 303: See Other httpResponse with a location  HttpHeader:

The actual RedirectLocation can be a deeplink or /p/ URL pointing to the place you want your user to go. 

 

You will likely face the issue that your User no longer has a Session. You can fix this by calling a Java action that sets the old Session data (before leaving website 1 initially) in the Cookies of the 303 Redirect. This question has some code for it (didn't try it myself). Note that that Forum Post already includes a HttpHeader Redirect at the bottom of the code, but you can also do this in your microflow to keep it a little bit more readable. 

 

This AutoLogin part is rather tricky and requires some Java knowledge. Be careful with implementing this as bad implementation can lead to vulnerabilities in your application!

 

Hope this helps.

answered