Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Logout (RAP 2.1)
Logout (RAP 2.1) [message #1063641] Thu, 13 June 2013 14:56 Go to next message
Oliver B. is currently offline Oliver B.Friend
Messages: 38
Registered: November 2010
Member
Hello,

I am migrating our RWT standalone application from RAP 1.4 to 2.1 (RC3).
Most of the changes worked without problems and our application is running with the new version.

The only unsolved problem is the logout procedure.
We used some old code examples to achieve the logout in RAP 1.4.
I tried to rework it with samples from the forum.

But I have not found a working solution.
Especially with the new multi-tab feature.

The tab that executes the logout (http session invalidation) will be logged out successfully and redirected to the login page.
The additional tabs are running into bug 390711 because we use form authentication in tomcat.
I tried to use the custom jsp from the bug. But if the ExitConfirmation is enabled and the user refuses the json redirect the client will crash with javascript error:
Error: TypeError: a is undefined

What is the preferred way to implement a logout procedure in RAP 2.1?

Thanks,
Oliver
Re: Logout (RAP 2.1) [message #1063763 is a reply to message #1063641] Fri, 14 June 2013 07:17 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
Hi Oliver,
such kind of errors (JavaScript) are definitely bugs. Could you open a
bugzilla and provide more detailed information about the crash? A simple
project to reproduce the issue is welcomed.
Best,
Ivan

On 6/13/2013 5:56 PM, Oliver Mising name wrote:
> Hello,
>
> I am migrating our RWT standalone application from RAP 1.4 to 2.1 (RC3).
> Most of the changes worked without problems and our application is
> running with the new version.
>
> The only unsolved problem is the logout procedure.
> We used some old code examples to achieve the logout in RAP 1.4.
> I tried to rework it with samples from the forum.
>
> But I have not found a working solution.
> Especially with the new multi-tab feature.
>
> The tab that executes the logout (http session invalidation) will be
> logged out successfully and redirected to the login page.
> The additional tabs are running into bug 390711 because we use form
> authentication in tomcat.
> I tried to use the custom jsp from the bug. But if the
> ExitConfirmation is enabled and the user refuses the json redirect the
> client will crash with javascript error:
> Error: TypeError: a is undefined
>
> What is the preferred way to implement a logout procedure in RAP 2.1?
>
> Thanks,
> Oliver

--
Ivan Furnadjiev

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Logout (RAP 2.1) [message #1063768 is a reply to message #1063763] Fri, 14 June 2013 07:45 Go to previous messageGo to next message
Oliver B. is currently offline Oliver B.Friend
Messages: 38
Registered: November 2010
Member
Hi Ivan,

thanks for the reply.
Yes, I think it is a bug concerning the workaround login page in bug 390711.
The JSON-redirect is clashing with the exit confirmation breaking some code.
I will see if I can create a standalone example.

But is there any chance that bug 390711 will be fixed in the final 2.1?
Then the session timeout message will be displayed and the workaround would not be needed.

Thanks,
Oliver
Re: Logout (RAP 2.1) [message #1063811 is a reply to message #1063768] Fri, 14 June 2013 11:02 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Oliver,

the problem with form-based authentication is that this method is just
not suitable for Ajax applications because it intercepts XHR reqests and
redirects to some login/logout HTML page. So the XHR request that
expects data in a given format will receive HTML content instead.

To make it worse, the redirect is completely transparent to the XHR API,
so there's no way for the client to react on it.

So there's no obvious fix for bug 390711. I didn't quite understand how
multiple tabs change the thing. Could you post the response JSON that
lead to the "TypeError: a is undefined"?

Regards,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Logout (RAP 2.1) [message #1063824 is a reply to message #1063811] Fri, 14 June 2013 11:50 Go to previous messageGo to next message
Oliver B. is currently offline Oliver B.Friend
Messages: 38
Registered: November 2010
Member
Hi Ralf,

thanks for the explanation.
I understand now that there is no easy fix for bug 390711.

These were the steps that led to that error:

1. Open multiple tabs for the same application/session
2. In one tab the user presses logout and the http session is invalidated and the user is sent to logout/login page
3. The other tabs will be informed of the logout with the next request (tomcat redirects to login page because of the invalid session cookie)
4. That XHR request fails and the json redirect to the login page is issued (using the sample jsp login page from bug 390711)
5. Before the json redirect is processed the browser exit confirmation triggers
6. If the user denies the browser exit confirmation the javascript error occurs

Everything works fine if the user confirms the exit confirmation

This is the complete error message:


Client Error
Details:

Error: TypeError: a is undefined

  Script: 


{
  "head": {
    "redirect": "https://localhost/App/start"
  }
}



  fileName: https://localhost/App/rwt-resources/rap-client.js
  lineNumber: 228
  columnNumber: 130
  Stack: rwt.remote.MessageProcessor.processMessage@https://localhost/App/rwt-resources/rap-client.js:228
.members._handleSuccess@https://localhost/App/rwt-resources/rap-client.js:232
@https://localhost/App/rwt-resources/rap-client.js:96
rwt.remote.Request.prototype._onReadyStateChange@https://localhost/App/rwt-resources/rap-client.js:96
.statics.bind/d@https://localhost/App/rwt-resources/rap-client.js:14

  Debug: off
  Request: {"head":{"requestCounter":6},"operations":[["set","w23",{"activeControl":"w49"}],["set","w49",{"selection":["w108"]}],["notify","w49","Selection",{"item":"w108","detail":null,"shiftKey":false,"ctrlKey":false,"altKey":false}],["set","w49",{"focusItem":"w108"}],["notify","w49","MouseDown",{"button":1,"x":512,"y":401,"time":125465,"shiftKey":false,"ctrlKey":false,"altKey":false}],["notify","w49","MouseUp",{"button":1,"x":512,"y":401,"time":125577,"shiftKey":false,"ctrlKey":false,"altKey":false}],["set","w1",{"cursorLocation":[512,401],"focusControl":"w49"}]]}


Thanks,
Oliver
Re: Logout (RAP 2.1) [message #1063903 is a reply to message #1063824] Fri, 14 June 2013 21:30 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Thanks for your detailed explanation. Now I got it.

Obviously, the exit confirmation doesn't make sense when the session has
timed out, there is no way to continue anyway. We should probably
disable the exit confirmation just before following the redirect, as the
thing interferes with redirecting. Could you please open a new bug for this?

Unfortunately, it's too late to fix this for 2.1, but the fix could
become part of a service release.

Best regards,
Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Logout (RAP 2.1) [message #1063986 is a reply to message #1063903] Mon, 17 June 2013 07:05 Go to previous message
Oliver B. is currently offline Oliver B.Friend
Messages: 38
Registered: November 2010
Member
I opened the new bug for this topic:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=410895

Regards,
Oliver
Previous Topic:TabFolders in RAP crash
Next Topic:RAP developers wanted
Goto Forum:
  


Current Time: Thu Mar 28 12:39:33 GMT 2024

Powered by FUDForum. Page generated in 0.04406 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top