Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0048855Openbravo ERPZ. Otherspublic2022-03-21 14:082022-07-07 09:31
dromero 
AugustoMauch 
normalmajorN/A
closedfixed 
5
 
PR22Q3 
cberner
Core
No
0048855: Openbravo logout with AuthenticationManager implementation
After speaking with Asier Lostalé, he thought it was appropriate to report the following issue, which was reported in Zendesk by the Partner I quote:

"We have implemented AuthenticationManager to use openam and everything works correctly.
At the time of logout we want to leave openbravo but not openam, for this we are trying to redirect to a new url, but it does not work, redirects to openbravo login always.

This is the code we put:
@Override
protected void doLogout(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

response.sendRedirect("www.example.com");

}"
N/A
No tags attached.
Issue History
2022-03-21 14:08dromeroNew Issue
2022-03-21 14:08dromeroAssigned To => Triage Omni OMS
2022-03-21 14:08dromeroModules => Core
2022-03-21 14:08dromeroTriggers an Emergency Pack => No
2022-03-21 15:40aferrazAssigned ToTriage Omni OMS => Triage Platform Base
2022-03-22 07:30ivancaceresIssue Monitored: ivancaceres
2022-04-04 18:57dromeroNote Added: 0136322
2022-04-11 18:43dromeroNote Added: 0136476
2022-04-19 13:40AugustoMauchAssigned ToTriage Platform Base => AugustoMauch
2022-04-19 13:40AugustoMauchStatusnew => scheduled
2022-04-19 13:49hgbotNote Added: 0136595
2022-04-19 15:21ivancaceresNote Added: 0136599
2022-04-20 13:19AugustoMauchReview Assigned To => cberner
2022-04-20 13:53AugustoMauchNote Added: 0136630
2022-04-20 15:00ivancaceresNote Added: 0136643
2022-04-20 17:56AugustoMauchNote Added: 0136652
2022-04-22 14:14ivancaceresNote Added: 0136686
2022-04-25 18:26hgbotResolutionopen => fixed
2022-04-25 18:26hgbotStatusscheduled => closed
2022-04-25 18:26hgbotNote Added: 0136730
2022-04-25 18:26hgbotFixed in Version => PR22Q3
2022-04-25 18:26hgbotNote Added: 0136731
2022-07-07 09:31plujanDescription Updatedbug_revision_view_page.php?rev_id=24435#r24435

Notes
(0136322)
dromero   
2022-04-04 18:57   
Hello, any news on this matter? I note that the status of the issue remains the same since it was reported.

Regards,
Demián
(0136476)
dromero   
2022-04-11 18:43   
Hello, we are on the issue due date. Haven't you had time to review it? Do you need me to extend the due date for the issue to be addressed?

Regards,
Demián
(0136595)
hgbot   
2022-04-19 13:49   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/563 [^]
(0136599)
ivancaceres   
2022-04-19 15:21   
Hi Augusto,

I have tried the solution but it doesn't seem to work with AuthenticationManager implementation.

Thanks
(0136630)
AugustoMauch   
2022-04-20 13:53   
Hello Ivan,

Thanks for testing it. Can you explain how could I test it with the AUthenticationManager implementation? If you cannot attach it to this issue you can share it with me at augusto.mauch@openbravo.com
(0136643)
ivancaceres   
2022-04-20 15:00   
Hi Augusto,

Yo can try with AutologonAuthenticationManager.
(0136652)
AugustoMauch   
2022-04-20 17:56   
I just tested it and it worked fine, I was properly redirected. See attached video:
- I opened an incognito window to ensure a clean session
- Opened openbravo, was logged in automatically
- On logout I was properly redirected

Openbravo.properties modified configuration:
authentication.class=org.openbravo.authentication.basic.AutologonAuthenticationManager
authentication.autologon.username=Openbravo
logout.redirect=https://www.google.com [^]
(0136686)
ivancaceres   
2022-04-22 14:14   
Hola Augusto,

Lo he probado con nuestro módulo que implementa OpenAM y he conseguido que funcione.

He tenido que copiar el método doLogout() de la clase AutologonAuthenticationManager

  @Override
  protected void doLogout(HttpServletRequest request, HttpServletResponse response)
      throws ServletException, IOException {
    response.sendRedirect(HttpBaseUtils.getLocalAddress(request));
  }

Un saludo y gracias por el parche
(0136730)
hgbot   
2022-04-25 18:26   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/563 [^]
(0136731)
hgbot   
2022-04-25 18:26   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: c9bfab20ee62f3e1fc2b8a6f71a1c3af8cc365a3
Author: Augusto Mauch <augusto.mauch@openbravo.com>
Date: 25-04-2022 17:57:31
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/c9bfab20ee62f3e1fc2b8a6f71a1c3af8cc365a3 [^]

Fixes ISSUE-48855: Custom logout redirects can be defined

By default when logging out the user is redirected to the Openbravo login page. Now it is possible to define custom redirect urls by setting the Logout Redirect URL (LogoutRedirectURL search key) preference:
- as system admin
- with all Visible At fields empty

Value example: https://www.google.com [^]

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/ApplicationComponent.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/templates/application-js.ftl
M src-db/database/sourcedata/AD_REF_LIST.xml
---