Perhaps instead use mendix built-in linking? E.g. make a page accessible to anonymous users, set the page link in the properties tab, use the page parameter id to make it unique to the page object.
Hi Martin,
Probably you are redirecting to /SSO/ from your index file. Then you are always running into SSO before getting to the navigation of the app. What we have done is putting the SSO redirect in the mf used in ‘Default Home page’ in the navigation settings. An anonymous user always runs into this mf. Then you first check if the user is entering via a deeplink. If so then the deeplink is executed. If not then you can redirect to /SSO/ . This can be done by opening a page with an htmlSnippet or URL redirector widget. When the user is authenticated, he comes back into the app with an account and a user role and will be navigated via the RoleBased Home page.