cancel
Showing results for 
Search instead for 
Did you mean: 

WD ABAP and PORTAL: Logging the user out

Former Member
0 Kudos

I have a requirement where I need to logout the user of my web dynpro abap application(the application resides in portal).

I need to log him out of portal.

How would I do that?

Thanks in advance

Accepted Solutions (0)

Answers (7)

Answers (7)

Former Member
0 Kudos

My god...

No one suggested the use of portal eventing ????

juste raise the logoff event in your web dynpro application...


  DATA lo_api_component  TYPE REF TO if_wd_component.
  DATA lo_portal_manager TYPE REF TO if_wd_portal_integration.

  lo_api_component = wd_comp_controller->wd_get_api( ).
  lo_portal_manager = lo_api_component->get_portal_manager( ).

  CALL METHOD lo_portal_manager->fire
    EXPORTING
      portal_event_namespace = 'urn:com.sapportals.portal:user'
      portal_event_name      = 'logoff'.

and thats all you need.

Former Member
0 Kudos

Hi, Mathieu,

your solution seems to strike all the other suggestions for users like me, who aren't familiar with WD at all. Nevertheless, I tried to implement your lines but suffered error messages saying "Abstract class CL_WDR_COMPONENT cannot be instantiated". I tried this because method WD_GET_API() is private or protected, so I obviously have to do this from inside WD. How can I get to there? Additionaly I didn't come across over the also needed param window_manager.

So, could you please give us a hint for achieving this with pure ABAP knowledge: what classes / views need to be instantiated for getting the right view controller (there seem to be a lot)? Which of the occasional DO_INIT / DO_REQUEST methods are necessary?

Kind Regards,

Peter Eilers

Former Member
0 Kudos

Hi Peter,

This code has to be put in the view of the WD application which will trigger the logoff.

wd_comp_controller is an attribute automatically instancied in all WD views, so it won't work outside of web dynpro.

You have to access to your web dynpro application (t-code se80) and put this in an action at button click by example.

Regards,

Mathieu.

Former Member
0 Kudos

Hi

Could you please tell me what kind of screen you have ?

Because if logout button is in portal then it can be done through navigation fetaure of portal by creating a portal component

Thanks and Regards

Himani Singh

Former Member
0 Kudos

Hi,

http://<portalserverurl:port>/irj/servlet/prt/portal/prtroot/com.sap.portal.navigation.masthead.LogO...

This is the component which log off user out of portal... You can call this url on exit plug from webdynpro component... I have not tested it from WD application, however I used this in JSPdynpage application to force user log off.

Hope it is helpful..

Nitesh

Former Member
0 Kudos

Hi Prahsant,

call an exit plug from the button you click.

In this case the "logoff page" defined in the ICF-node of your WDA application is called.

In the ICF node (Transaction SICF) you can put a logoff page.

Unfortunately I cannot post the html-coding within here.

I can send you an email if you want to.

Best regards

Sebastian

Edited by: Sebastian Menger on Jul 8, 2010 8:58 AM

former_member192854
Active Participant
0 Kudos

Hi Prashant,

in order to create a good logoff, I created a popup window, with my own text:

'You are now been logged off' and an 'Ok' button. Next to that I created an IFrame in the same view with the source attribute:

'/zlogoff?~command=logoff' and the height and widht attributes on: '0 px'. This is done so the element is enabled but not visible. If the visibility attributes itself is disabled, the solutions isn't working.

This /zlogoff is a self created Alias. This can be created with transaction SICF:

- Press button 'External Aliases';

- Press create new icon or F5;

- Choose a name for the alias in External alias, for this example: /zlogoff

- Enter a Description in the description field;

- Search the element '/default_host/sap/bc/gui/sap/its/webgui' to trigger in the Trg Element tab.

When you have double clicked this element, it's shown as Trg Element down the name of your External alias.

- Save the alias;

When you now created the proper navigation (on exit of the window, call the exit plug of the window which is calling the popup) in order to navigate away, the user is logged off succesfully.

Hope this was helpfull.

Kind regards,

Sander

former_member192854
Active Participant
0 Kudos

By the way,

I came across this message. My answer is a solution to create a logoff functionality without using the portal.

Kind regards,

Sander

former_member190178
Participant
0 Kudos

Cheers to Sander.

His suggestions solved the issue.

0 Kudos

Deleting the Authentication in Logoff

When you log off from some applications, the authentication of the user may also have to be reset in the browser, which means that a new authentication is needed when the application is called again. If basic authentication is used for the logon, this information can only be deleted in the browser with Internet Explorer 6.0 SP1 and higher.

document.execCommand( 'ClearAuthenticationCache' );

If an SSO2 cookie is used for the authentication, you can delete the cookie with JavaScript:

function DelSso2Cookie(sName,sPath)

{

var sso2Domain = location.hostname;

if (location.hostname.indexOf(".")>0)

sso2Domain = location.hostname.substr(location.hostname.indexOf(".")+1);

p="";

if(sPath)p=" path="sPath";";

document.cookie = sName"=0; expires=Fri, 31 Dec 1999 23:59:59 GMT;"p + "domain="sso2Domain";";

}

You can also include this JavaScript in logoff pages.

former_member4529
Active Contributor
0 Kudos

Hi Prashant,

You can use an Exit Plug to achieve this.

Thanks & Regards,

Dipankar

Former Member
0 Kudos

This is by design not supported directly in WDA.

If you MUST have this,

then a WINDOW exit plug, can have a URL. Just add URL to parameters.

This URL, could be a BSP.

This BSP can have JAVA script that SHOOTs the browser eg window.close()

or you can kill their SSo2 cookie with JAVA script.

I had a customer that demanded the browser be closed, and used a small BSP.

They liked the result.

I personally dont like it, since the portal, has an exit button and an idle logout.

We deliberately dont build WDAs this way.

Hope this helps,

Phil

Ulli_Hoffmann
Contributor
0 Kudos

Hi Prashant,

when the wd application runs in the portal and the user loggs himself off from the portal, the session of the wd application in the backend will also be closed. This is handled by portal session management automatically.

regards, Ulli

Former Member
0 Kudos

Thanks for the response Ulli.

It dosent help me because I want to do a force logout. I dont want to wait for the user to logout.

I believe there is a way to clear the cookie which kills his current login.

former_member215843
Active Participant
0 Kudos

Hi Prashant,

I am afraid that the feature your request is not available with WD ABAP.

Ciao, Regina