cancel
Showing results for 
Search instead for 
Did you mean: 

Logout User from Link on View

Former Member
0 Kudos

Hi WebDynpro's,

I am running EP6 SP14.

I need to logout the user from a WebDynpro application when a link is clicked. What is the best way to do this?

For the implementation of the logoff link, I tried to use the following code

<b>UMFactory.getAuthenticator().logout(req, res);</b>

as was suggested by other SDN members.

Unfortunately, .logout is not a defined method for getAuthenticator(). The method does not show up as valid when doing a code assist. I see .getLoggedInUser in the list of valid methods, but not .logout

Thoughts?

Kevin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Kevin,

Use WDClientUser.forceLogoffClientUser(url)

You may use null url also, see API documentation what url will be used in this case.

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

Former Member
0 Kudos

Hi Valery,

Will WDClientUser.forceLogoffClient log the user off the portal? That is my primary objective. I've tried using that command in the past without much success. That command seems to expire the WebDynpro application only; it did not seem to logout the user from the portal.

Thoughts?

Thanks,

Kevin

Former Member
0 Kudos

Kevin,

You are right. This code log-off user only from WD application.

Sorry for confusion.

VS

Former Member
0 Kudos

I did some more testing. It seems that forceClientLogoff() does expire the portal authentication credentials. However, after clicking on the logoff link on the WebDynpro page, the portal displays the portal desktop framework (like nothing happened) and the WebDynpro iView shows the error "200 Application Terminated". If I click refresh or any other portal tab at that point, the portal then senses that I'm expired and sends me to the default portal login page.

Can I specify some URL ("/irj/portal") in the sap.logoffURL property for the WebDynpro application such that the portal default login page appears immediately after the user clicks on Logoff? I don't want the user to see this ugly "200 Application Error" page.

Thanks,

Kevin

Former Member
0 Kudos

Hi Kevin,

Try using this url as the sap.logoffURL: "/irj/portal?logout_submit=1".

Regards,

Satyajit.

Former Member
0 Kudos

Satyajit,

Thanks much for your post. Using url "/irj/portal?logout_submit=1" in the sap.logoffURL parameter for the WD application works almost perfectly. Now when I click on Logoff the portal default login page is displayed in the browser window, and the portal authentication credentials have been deleted so the user must login again.

The only minor problem now is that upon clicking logoff a new (2nd) small browser window opens, and it too displays the default login page. Is this a result of the portal trying to show the "confirm/verify logout yes/no prompt" and the authentication credentials have already been deleted? Is there some variant URL to suppress this other window and this prompt?

Thanks,

Kevin

Answers (0)