cancel
Showing results for 
Search instead for 
Did you mean: 

Logout from WD4A application

bartlomiej_lach
Participant
0 Kudos

Hello experts!

I struggle with one point. It will be quite long, but for sure details are most important here.

WE have two servers A and B. On server A we have portal with applications assigen to that system, beside that we create a link to WD4A application on server B. When you click a link in iframe we open application from server B with logon screen (different users/passwords to servers) and here everything is nice, probem is when I try to logout. When user finishs his work on application from server B, he should click logout and come back to login screen, but authentication for server A portal should be still valid.

What I tried:

1. Method document.execCommand( 'ClearAuthenticationCache' ); from SAP website http://help.sap.com/saphelp_nw04s/helpdata/en/fc/04a5421935c511e10000000a1550b0/content.htm but as they mentioned it clears cookies for portal also.

2. I also tried trick from http://scn.sap.com/community/web-dynpro-abap/blog/2012/07/24/changing-the-default-wd-abap-error-page  it looks like that

<!DOCTYPE html PUBLIC"-//W3C//DTD HTML 4.01Transitional//EN"><html><head>

<title>

Logging out

</title>

<META http-equiv="Content-Type" content="text/html;charset=UTF-8"><head></head>

<body><html><body>   <span id="onloadscript">  

<!--  

alert("Script is running");

document.cookie = "COOKIE_RESPONSIBLE_FOR_APP" + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";

document.cookie = "MYSAPSSO2" + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";

-->  

</span>   <img s

rc="/sap/public/bc/ur/nw5/1x1.gif"      

onload="        

var onloadscript = document.getElementById('onloadscript');

var scriptText = onloadscript.childNodes[0].nodeValue;        

eval(scriptText); " />

</body>

</html>

but it doesn't work... cookies are still valid. For sure script is working as I put alert inside to check it.

Have anyone of you before faced with such requirement and know how to solve it.

Thanks in advance

Bartlomiej

Accepted Solutions (1)

Accepted Solutions (1)

bartlomiej_lach
Participant
0 Kudos

Hello Sharath!

Thank you for your input, ufortunatelly it didn't help me, however I found one solution.... it's one line of code in WD4A. If someone needs such solution, it's sufficient to put...

CALL METHOD wdr_task=>server->logoff.

Seems that method kills all session cookies on server, so user need to login one more time. As it kills session only on calling application server, session on portal is still valid.

Regards

Bartlomiej

Answers (1)

Answers (1)

Sharathmg
Active Contributor
0 Kudos

Hello Bartlomiej,

As a recommended practise, we do not handle logout of individual systems.

The log-off of the iView related system is something new, for me. Can you share the specific reason for such a requirement.. as on logoff out of portal, both connections will be closed.

Regards,

Sharath

bartlomiej_lach
Participant
0 Kudos

Hello Sharath!

Many thanks for answer.

I need to close session in iView separately, because if I logoff form portal on server A, session for application from server B is still valid. I thought that portal logoff event clears whole authentication cache, but seems it doesn't.

May be we have wrong portal settings?

Regards

Bartek

Sharathmg
Active Contributor
0 Kudos

These two posts related to issues similar to yours, should help you in accomplishing your requirement:

http://scn.sap.com/thread/37898

http://scn.sap.com/message/11019405

Regards,

Sharath