cancel
Showing results for 
Search instead for 
Did you mean: 

HTML Logoff from SAP Portal 7.3

Former Member
0 Kudos

Hello,

I'm trying to do a SAP Portal log off in a custom app (webdynpro java). This app calls a HTML file.

In Portal 7.0 I typed the following:

<html>

<head>

  <title>Log off</title>

</head>

  <form action="/irj/portal" name="logoff" method="post">

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

  </form>

</body>

</html>

and it worked! But in our Portal 7.3 it doesn't work fine... any idea?

I also tried the following in Portal 7.3:

<html>
<head>
<script language="javascript">

function logoff()

{

EPCM.raiseEvent("urn:com.sapportals.portal:user", "logoff", "");

}
</script>
</head>
<body onLoad="logoff();">
</body>

</html>

but it also fails...

Thanks!

Miguel Angel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

Finally I found it:

<html>

<head>

</head>

<body onLoad="logoff.submit()">

  <form action="/irj/servlet/prt/portal/prtroot/com.sap.portal.navigation.masthead.LogOutComponent?logout_submit=true" name="logoff" method="post">

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

  </form>

</body>

</html>

Miguel Angel.

Former Member
0 Kudos

For me, calling the Logout component from a third party application also solved the problem terminating the portal session:

https://<portal-url>:50001/irj/servlet/prt/portal/prtroot/com.sap.portal.navigation.masthead.LogOutComponent?logout_submit=true

In my case I called the LogoutComponent as the Logout URL of a Fiori Launchpad configured on an AS ABAP

Answers (1)

Answers (1)

SandipAgarwalla
Active Contributor
0 Kudos

Miguel

For 7.3, you would have to us ethe AJAX LSAP APIs..For log off - API is

LSAPI.getSessionPlugin().logoff();

So you could use something like,

$('#logoff').click(function _onclick() {LSAPI_sessionPlugin.logoff();

});

Give it a try..

Sandip

Former Member
0 Kudos

Hello Sandip,

Please, could you give more details about it? How I should type it in a HTML file? By the way, I'm not using AJAX masterhead, I'm using Classic masterhead; it doesn't matter?

Thanks so much!

Miguel Angel.

sambaran
Explorer
0 Kudos

Hi Sandeep,

I am using Classic masthead in 7.3/

I tried to use a link <A href="javascript:performLogOff()">log out </A> to perform log out in my custom portal component with a custom  jsp.

Script:

function performLogOff(){

          LSAPI.getSessionPlugin().logoff();

}

But I am getting error LSAPI is Undefined.

Do you have any idea on this?

However if I am using this same script in my custom masthead (copy of standard) it is working fine.

Am I missing some reference here.

Please help me out.

Thanks & Regards,

Sambaran Chakraborty