# Custom login page depending on living application being accessed

**URL:** https://community.ofelia.com/t/custom-login-page-depending-on-living-application-being-accessed/11585
**Category:** Q&A
**Tags:** bonita-runtime
**Created:** [20 July 2023 14:45 UTC](https://community.ofelia.com/t/custom-login-page-depending-on-living-application-being-accessed/11585 "2023-07-20T14:45:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![unai.gaston.caminos](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/unai.gaston.caminos/32/1000_2.png) [@unai.gaston.caminos](https://community.ofelia.com/u/unai.gaston.caminos)
#### Post date: [20 July 2023 14:45 UTC](https://community.ofelia.com/t/custom-login-page-depending-on-living-application-being-accessed/11585/1 "2023-07-20T14:45:09Z")

</div>

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?

&nbsp;

Thanks in advance for your help.

Regards,

&nbsp;&nbsp;&nbsp; Unai

---

<div class="post-metadata">

### Author: ![Laurent\_Leseigneur](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/laurent_leseigneur/32/725_2.png) [@Laurent\_Leseigneur](https://community.ofelia.com/u/Laurent_Leseigneur)
#### Post date: [20 July 2023 15:05 UTC](https://community.ofelia.com/t/custom-login-page-depending-on-living-application-being-accessed/11585/2 "2023-07-20T15:05:50Z")

</div>

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&nbsp;Bonita Studio don't handle a custom login page as you are suggesting

---

<div class="post-metadata">

### Author: ![unai.gaston.caminos](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/unai.gaston.caminos/32/1000_2.png) [@unai.gaston.caminos](https://community.ofelia.com/u/unai.gaston.caminos)
#### Post date: [4 August 2023 10:10 UTC](https://community.ofelia.com/t/custom-login-page-depending-on-living-application-being-accessed/11585/3 "2023-08-04T10:10:51Z")

</div>

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 />
	&nbsp;</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 />
	&nbsp;</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>

```

&nbsp;

Hopefully this will help.

---

<div class="post-metadata">

### Author: ![unai.gaston.caminos](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/unai.gaston.caminos/32/1000_2.png) [@unai.gaston.caminos](https://community.ofelia.com/u/unai.gaston.caminos)
#### Post date: [21 July 2023 09:47 UTC](https://community.ofelia.com/t/custom-login-page-depending-on-living-application-being-accessed/11585/4 "2023-07-21T09:47:36Z")

</div>

Fair enough. Thank you, Laurent.

---

<div class="post-metadata">

### Author: ![ami05ne](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/ami05ne/32/1321_2.png) [@ami05ne](https://community.ofelia.com/u/ami05ne)
#### Post date: [5 May 2025 11:17 UTC](https://community.ofelia.com/t/custom-login-page-depending-on-living-application-being-accessed/11585/5 "2025-05-05T11:17:42Z")

</div>

hi unai , can u help me in my living application ?

---

<div class="post-metadata">

### Author: ![TaQuangKhoi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.ofelia.com/taquangkhoi/32/782_2.png) [@TaQuangKhoi](https://community.ofelia.com/u/TaQuangKhoi)
#### Post date: [3 July 2025 15:28 UTC](https://community.ofelia.com/t/custom-login-page-depending-on-living-application-being-accessed/11585/6 "2025-07-03T15:28:08Z")

</div>

> [@unai.gaston.caminos](#):
>
> with some pages in it, for example: [https://localhost:8080/bonita/apps/myWickedApp/blimeyPage](https://localhost:8080/bonita/apps/myWickedApp/blimeyPage)

Hi @unai.gaston.caminos ,

If you want the login page redirect to specific page in your application, you can hardcode the url in file `login.jsp` in the folder webapps of your Tomcat runtime.

See more at this source code =\> [bonita-engine/bpm/bonita-web-server/src/main/webapp/login.jsp at dev · bonitasoft/bonita-engine · GitHub](https://github.com/bonitasoft/bonita-engine/blob/dev/bpm/bonita-web-server/src/main/webapp/login.jsp)
