Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 14:31 Go to next message
Magnus Konze is currently offline Magnus KonzeFriend
Messages: 13
Registered: November 2014
Junior Member
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 07:53 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,
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 09:00 Go to previous messageGo to next message
Magnus Konze is currently offline Magnus KonzeFriend
Messages: 13
Registered: November 2014
Junior Member
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 09:24 Go to previous message
Ivan Furnadjiev is currently offline Ivan FurnadjievFriend
Messages: 2426
Registered: July 2009
Location: Sofia, Bulgaria
Senior Member
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: Thu Apr 25 09:47:36 GMT 2024

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

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

Back to the top