cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use LogOutComponent programatically in a Java iView?

Former Member
0 Kudos

Hi,

Can someone point me to the jar file(s) that I need to reference in my portal application project (Java PDK) to use LogOutComponent? Which ones do I need and where can I get them

I got the class file 'com.sap.portal.navigation.masthead_core.jar' from the Portal server but am not sure if this file is the only one that I need to use to incorporate LogOutComponent in my code.

Also, can somebody tell me that how can I call this component from my AbstractPortal Component to call logout programatically? I am not using JSPs and would ideally not like to redirect the response to the URL of this component but rather use the object in my Java code. Sample code to help with this would be appreciated.

Thank you,

- Vik.

Accepted Solutions (1)

Accepted Solutions (1)

darrell_merryweather
Active Contributor
0 Kudos

You don't really need to incorporate any jar files to use the portal logout functionality. You simply need an HTML form, which can submit to ANY URL within the portal. This form needs to have the parameter logout_submit with a value of "on". This will then tell the portal to activate the relevant login modules to log out the user

<form name="logoffForm" action="<ANY URL IN PORTAL>" method="POST">

<input type="hidden" name="logout_submit" value="on">

</form>

I hope this helps

D

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi there,

To log a user out of the Portal I decided to go the route of: UMFactory.getAuthenticator().logout(req, res)

Code is below.

Thanks for your replies,

- Vik.

<code>

IAuthentication Authen = UMFactory.getAuthenticator();

HttpServletRequest req = request.getServletRequest();

HttpServletResponse res = request.getServletResponse(true);

//logoff user from Portal

Authen.logout(req, res);

</code>