Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Getting the username after form-based authentication
Getting the username after form-based authentication [message #1498607] Thu, 04 December 2014 09:31 Go to next message
Eclipse UserFriend
Hi,

i'm using form-based authentication (with a servlet). Now i need the login name of the authenticated user. I found
RWT.getRequest().getUserPrincipal().getName();
but getRequest(...) is marked with 'This method is not recommended.'

Is it save to get the username with this method? If not, which is the correct way?
Re: Getting the username after form-based authentication [message #1499536 is a reply to message #1498607] Fri, 05 December 2014 02:53 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
what about RWT.getRequest().getRemoteUser()?
HTH,
Ivan

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: Getting the username after form-based authentication [message #1499605 is a reply to message #1499536] Fri, 05 December 2014 04:00 Go to previous messageGo to next message
Eclipse UserFriend
getUserPrincipal().getName() and getRemoteUser() return the same values (at least in my case).

But i'm worrying about RWT.getRequest(). Here is the JavaDoc:
Returns the HttpServletRequest that is currently processed. 

Note: This method is not recommended. Typical application code should not need to call this method. Processing requests from the client is up to the framework. In rare cases, an application may be wish to access request details such as certain HTTP headers.


I don't want to process requests, i just need the username. So, can i use this method?
Re: Getting the username after form-based authentication [message #1499627 is a reply to message #1499605] Fri, 05 December 2014 04:24 Go to previous message
Eclipse UserFriend
Sure

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Previous Topic:Modal and Modeless Shells
Next Topic:How to self-update RAP application?
Goto Forum:
  


Current Time: Sun Jul 06 15:55:16 EDT 2025

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

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

Back to the top