cancel
Showing results for 
Search instead for 
Did you mean: 

HCP HTML5(UI5) application logout not happening using userapi ?

Former Member
0 Kudos

I have configured following in neo-app.json

...
"routes": [
   {
     "path": "/services/userapi", 
     "target": {
       "type": "service",
       "name": "userapi"
     }
  }
]
...

Then I am trying to logout service call on a button press as given below,

$.ajax({
      "url": "/services/userapi/logout",
      "success": function() {
	    window.location.replace("http://www.abcd.com");
      }
});

Once this ajax call completed I can see the following message in browser network tab,

preview :

Note : I am not able to do logout functionality from the application but however if I am opening the same logout request url in new tab the logout happens successfully.

Am I missing some configuration ?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hi,

Finally I figured it out, please follow the below process for logout functionality in IDP configured application:

In neo-app.json ("logoutPage": "/logout.html",)

...
{
   "welcomeFile": "/index.html",
   "logoutPage": "/logout.html",
   "authenticationMethod": 
   "saml","routes": [{
...  


When logout event handler trigger : ie. on Button press event :

sap.m.URLHelper.redirect("logout.html", false);

Create a .html file in your root directory of your application (logout.html😞

<!DOCTYPE HTML>
<html lang="en-US">
    <head>
        <meta charset="UTF-8">
        <meta http-equiv="refresh" content="1; url=https:<url to the application>">
        <script type="text/javascript">
            window.location.href = "url=https:<url to the application>"
        </script>
        <title>Page Redirection</title>
    </head>
   <!-- <body>
        <!-- Note: don't tell people to `click` the link, just tell them that it is a link. -->
        Logging out.......
        <br><br>
        If you are not redirected automatically, follow this <a href='<url to the application>'>link</a>.
    </body> -->
</html>
benlim
Contributor
0 Kudos

Hi,

I'm facing similar issue whereby not able to logout. I tried the solution from @Jithin Kumar, it was able to navigate to the logout html page. But when i click back or rerun the app url, it wasn't get logout and still able to launch the app. The session does not get refresh using /services/userapi/logout.

Any input from this?

Thanks.

Regards,

Ben

0 Kudos

Hi ben_yslim

did you find solution - I have exact same issue.

Thanks

a_wuttig
Explorer
0 Kudos

we have the same issue. are there any solutions?

Yes, I found and I have updated it in the same thread on Aug 08, 2017 at 10:46 AM. Answer Link

If you are having trouble in this, please share your code I can help.

benlim
Contributor

Thanks @Jithin Kumar, this solution works!

Jacques-Antoine
Active Participant
0 Kudos

Hello Jithin,

On my side, when I use this technique, it reloads the application already logged on. I am still not able to kill the session. I am weel redirected to the logout page, but if I reload the page I am automatically authenticated.

Any idea on what can be causing this?

Thank you for your attention

Best

JA

former_member540067
Active Participant
0 Kudos

Hi Jithin.

App is trying to redirect to the following url but it is getting 404 error. Please help.

https://abc-xxxxxxxx.dispatcher.ap1.hana.ondemand.com/webapp/logout.html?saml2logoutresult=urn%3Aoas...

Answers (0)