Skip to content

Commit

Permalink
As something initialized via constructor, the field cannot be static
Browse files Browse the repository at this point in the history
  • Loading branch information
aaime committed Aug 14, 2018
1 parent e3d75a1 commit 8be7251
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
*/
public class GeoServerUserAuthenticationConverter extends DefaultUserAuthenticationConverter {

private static Object USERNAME_KEY = USERNAME;
private Object usernameKey = USERNAME;

/**
* Default Constructor.
Expand All @@ -42,13 +42,13 @@ public GeoServerUserAuthenticationConverter() {
public GeoServerUserAuthenticationConverter(final String username_key) {
super();

USERNAME_KEY = username_key;
usernameKey = username_key;
}

@Override
public Authentication extractAuthentication(Map<String, ?> map) {
if (map.containsKey(USERNAME_KEY)) {
return new UsernamePasswordAuthenticationToken(map.get(USERNAME_KEY), "N/A", null);
if (map.containsKey(usernameKey)) {
return new UsernamePasswordAuthenticationToken(map.get(usernameKey), "N/A", null);
}
return null;
}
Expand Down

0 comments on commit 8be7251

Please sign in to comment.