authentication - Play Framework 2.4.0 - How to retrieve the logged in user in play-java application -


i've created play-java web application, default application controller:

package controllers;  import play.*; import play.mvc.*;  public class application extends controller {      public result index() {         string loggeduser = ""; // request logged in user somehow...         return ok(loggeduser + ", hi there!");     } } 

what need retrieve user name logged in :
i'm visiting "http://localhost:9000" chrome browser, , need retrieve windows logged-in user browses play application, in order check premissions our db users tables.

in servlet api - think possible using:

string name = request.getuserprincipal().getname(); // or string name = request.getremoteuser(); 

in asp. mvc webapi controller- correspond code is:

httpcontext.current.user.identity.name 

how can implement in play-framework simple java application?

====================
update:
believe need implmenet windows authentication (ntlm) in play java application in order windows username browses play application remotely. can please assist me this?


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -