This is exactly the problem I am facing. The first timeI use the deeplink with SSO I get logged in, but goes to the homepage. After opening a new browsertab and again entering the deeplink I am redirected to the right page. The default microflow to go to the homepage starts with the DeeplinkHome microflow. May I ask you if you are still facing the problem or did you fixed it? Then I am really curious about the solution, and I hope you can help me :)
Yes, we were able to figure it out. It took a little additional code to the java actions in the deeplink and Sapauthentication modules, but yes.
The problem that we found is that the original incoming URL (The deeplink URL) was getting lost during the two redirects that take place to handle the XSUAA integration. One redirect to /xsauaalogin/, and then the next being the callback, /xsuaacallback?code=******
The fix here is to intercept the incoming URL in the deeplink module and use that url to set a custom cookie(We named ours ORIGINALURL). Then you use that cookie during the redirect at the end of the xsuaa process (This can be found in the event listener for /xsuaacallback/). One thing to keep in mind is, after using the cookie to grab the original url, you’ll want to delete it so that a user isn’t consistently redirected back to that same deeplink.
- We grabbed the incoming deeplink url around line 365 in StartDeeplinkJava.java. This is the loginlocation loop, which you’ll still need to configure. So we don’t grab the original url or track it if the login location isn’t configured.
- We handled the cookie around line 150 right after the login call and inside the login transaction’s… transaction in StartXsuaaIntegration.java
- You’ll need to make the original url an absolute link
I hope this helps, and I’d be happy to go over it with you if you want. :)
The issue with the deeplink has been addressed in the sap XSUAA connector v2.1.3.
So simply upgrading the mendix module and setting the “LoginLocation” constant to “/xsauaalogin/” should do the trick.