XSUAA Authentication + Deeplink Module Problems

0
Hey again guys, I’m experiencing some weird behavior with this app that utilizes both the XSUAA Authentication module from the app store and the Deep Link Module. The weird behavior:    – When I configure the Deep Link module with the LoginLocation pointing to the login page that’s handling the SAP SSO login (https://localhost:8088/login-with-sso.html?f=true&cont=), and have ‘Allow guests’ turned off in order to force authentication, the SSO works fine and logs in the user, however, the deep link is never executed. However, this only happens the first time a user tries to get into the app by way of deep link. If they have already authenticated and have an existing cookie, when they try a second time to visit the deep link they will get in and the deep link will function properly. Some notes: - With the ‘Allow guests’ flag checked, there are no problems executing the deep link, however SSO doesn’t work. - When trying to hit the deep link with SSO configured as stated above, none of the deep link logs are appearing, so no part of the deep link module is being handled on that initial attempt. - Again, the second attempt with SSO implemented and configured, everything works the way it’s supposed to and the deep link executes, it’s just the first time after opening a new browser and re-authenticating .   So, I guess my question is, has anyone else experienced this before? Do I have my login location URL properly configured or is that the issue? Any pointers or advice here? Thanks in advance!
asked
2 answers
0

Hi Austin,

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 :)

answered
0

@Ferdy
Hey Ferdy!
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.

DeepLink Info:
- 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.

XSUAA Info:
- We handled the cookie around line 150 right after the login call and inside the login transaction’s… transaction in StartXsuaaIntegration.java

Final Tip:
- 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. :)

answered