I’m trying to get username inside my Vaadin application. We use kerberos to authenticate users on Tomcat or Weblogic application servers. Authentication is made by app server. So, if i use servlet API then i just use this code to get all info about user:
// request is the HTTPRequest instance
// Get the user’s windows user ID
String userID = request.getUserPrincipal().getName();
// Get the authentication information
AuthInfo info = Sso.getAuthInfo(request);
// Get the user’s realm
String realm = info.getAuthenticatiedUser().getRealm();
// Get the user’s Active Directory group information
String groups = info.getAuthenticatiedUser().getGroups();
One way to communicate this information to other parts of the application would be to use Application.setUser(Object) to set your own user object with all the necessary information.