Deeplink module cant find username/password in request

1
Hello all, I'm seeing some strange behavior with the deeplink module in a current project. When trying to call a deeplink, I always get the following (debug) log message: No session found for deeplink: /link/Test, attempting to serve link as guest. I debugged the module in Eclipse and found that the problem lies in this java statement: if (request.getParameter(ARGUSER)!= null && request.getParameter(ARGPASS) != null) { Where ARGUSER = username and ARGPASS = password. Both are always 'null', even when signed in as a user. The method then skips to an anonymous login attempt. I've made a test-project to investigate the issue (local deployment) and saw the same behavior. I then updated the test project to Mendix 5.16.1 and continued to see the same. I've tried adding a few extra lines of code to extract all parameterNames from the request, but the result was an empty list. That can't be right, so my own investigation is ongoing in that regard. Nonetheless, I figured I'd throw the issue out here. Has anyone experienced anything similar? Am I perhaps overlooking something obvious? Any input is appreciated. Kind regards, Chris
asked
4 answers
1

I have actually successfully used the deeplink with an active session in the past.
The Java code has been designed to accommodate to re-use existing session. If the deeplink module would recreate the session or require you to login every time that could give you some frustrating results.

The variables arguser and pass aren't necessary though. Those are intended for logging in using a url such as: /link/Test?username=MxAdmin&password=1

However there is a function that should evaluate the request and check if there is an active session. That step in the process (Stardeeplink.java:line130) should get the active session and use that for the deeplink.

The debug message you are referring to is incorrect though. It says that there is no session found, while in fact that message should say that no username/password have been provided.
There are no debug messages that actually provide you with the information you are looking for.

answered
1

This part of the deeplink is not functional. If fact the login cookie is set in a sub routine. You could adapt the above part by retrieving the username and session from the cookie and check whether this valid.

Your case is also visible if you call the same deeplink twice in the same browser, it will create two sessions, which is not needed.

answered
1

Jasper is correct. I've done some further code-level debugging, and it turned out the code itself is correct, but the debug/trace messages are confusing.

The reason that the deeplinks kept redirecting to the main page was not that there was no session available (as the log message suggested), but that in our Mendix project, a role-based homepage was set for the user in question. That role-based homepage didn't contain the deeplink logic (instead it simply called a page).. Result: The pending link was correctly generated, but the homepage call for the user never picked up on it.

Thanks for the input people!

Regards, Chris

answered
0

Basically, calling a deeplink to access a page using an existing user session does not currently work? Good to know. Means I'm not wasting time trying to find a workaround :)

Thanks for the answer & the advice!

answered