[Geoserver-devel] [jira] (GEOS-6144) Have a better chance of logging the remote user in monitoring across different auth systems

Andrea Aime created BugGEOS-6144
Have a better chance of logging the remote user in monitoring across different auth systems

Issue Type:

BugBug

Assignee:

Justin Deoliveira

Components:

Monitoring

Created:

08/Nov/13 9:18 AM

Description:

Quoting Christian’s observation about how we get the user:

Different authentication mechanisms produce different kind of authentication objects. It is not guaranteed that auth.getPrincipal() is a user object. The Spring Security Authentication interface declares

Object getPrincipal();

Maybe the the following change would help to improve the situation

if (auth.getPrincipal() != null ) {
if (auth.getPrincipal() instanceof User) )

Unknown macro: { data.setRemoteUser(((User)auth.getPrincipal()).getUsername()); }

else

Unknown macro: { data.setRemoteUser(auth.getPrincipal().toString); }

}

Project:

GeoServer

Priority:

MajorMajor

Reporter:

Andrea Aime

This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: [http://www.atlassian.com/software/jira](http://www.atlassian.com/software/jira)