WPS GetExecutions Operation Impl - Improve the way it recognizes the principal username

Description

Currently, the Execute run method in order to recognize the Principal username just blindly does an "auth.getPrincipal().toString()".

This is of course not fully correct hence the "toString()" method does not necessarily return the clean username. And this is exactly what happens when the Principal is an instance of Spring Security Context "UserDetails".

The correct way to handle this would be to check if the Principal is an instance of "UserDetails", cast it and return the clean username to be added to the filter.

Environment

None

Assignee

Alessio Fabiani

Reporter

Alessio Fabiani

Triage

None

Fix versions

None

Affects versions

Components

Priority

Medium
Configure