Hi,
Say I have a living application running on my Bonita runtime: https://localhost:8080/bonita/apps/myWickedApp
with some pages in it, for example: https://localhost:8080/bonita/apps/myWickedApp/blimeyPage
Now, if a user tries to access directly the blimeyPage without having a Bonita session open, the user is automatically redirected to the Bonita login page at:
https://localhost:8080/bonita/login.jsp?redirectUrl=%2Fapps%2FmyWickedApp%2FblimeyPage
But,
- Would it be possible to have in that case the user be redirected to an "app-specific" custom login page instead? For example:
https://localhost:8080/bonita/apps/myWickedApp/wickedLoginPage?redirectUrl=%2Fapps%2FmyWickedApp%2FblimeyPage
- If so, which would be the steps to follow?
Thanks in advance for your help.
Regards,
Unai
1 Like
Hi Unai,
I think it not possible since redirect URL comes from link or bookmark and is not calculated when users is not logged in. Application descriptor defined int he Bonita Studio don't handle a custom login page as you are suggesting
1 Like
Well, these are some additional answers provided by the Bonitasoft R&D team:
- For the time being, there doesn't seem to be a straightforward way of achieving your goal:
<ul>
<li><span id="CaseDetail:j_id31:j_id60:j_id61:2:j_id159">Whenever the Bonita engine detects a user has no valid session, it redirects systematically to the <span style="font-family:Courier New,Courier,monospace;"><span style="background-color:#afeeee;">login.jsp</span></span> page at the root of the Bonita web application.</span></li>
<li><span id="CaseDetail:j_id31:j_id60:j_id61:2:j_id159">This <span style="font-family:Courier New,Courier,monospace;"><span style="background-color:#afeeee;">login.jsp</span></span> page is unique, meaning that users will always be redirected to the same page, regardless of the application they were trying to access in the first place.</span><br />
</li>
</ul>
</li>
<li><span id="CaseDetail:j_id31:j_id60:j_id61:2:j_id159">You could of course customise this <span style="font-family:Courier New,Courier,monospace;"><span style="background-color:#afeeee;">login.jsp</span></span> page to some extent.</span>
<ul>
<li><span id="CaseDetail:j_id31:j_id60:j_id61:3:j_id164">Customise the <span style="font-family:Courier New,Courier,monospace;"><span style="background-color:#afeeee;">login.jsp</span></span> page so that it gathers the <em><span style="font-family:Courier New,Courier,monospace;">redirectUrl</span></em> parameter and, depending on the value of the <em><span style="font-family:Courier New,Courier,monospace;">redirectUrl</span></em> parameter, it then dispatches/redirects to the appropriate custom clone of that login page.</span><br />
</li>
</ul>
</li>
<li><span id="CaseDetail:j_id31:j_id60:j_id61:3:j_id164">Or else, you could set up some kind of Tomcat valve that will intercept the requests to <span style="font-family:Courier New,Courier,monospace;"><span style="background-color:#afeeee;">login.jsp</span></span> and display your own custom page instead (based on the <em><span style="font-family:Courier New,Courier,monospace;">redirectUrl</span></em> parameter). </span></li>
Hopefully this will help.
1 Like
Fair enough. Thank you, Laurent.
1 Like