Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
GUAC-1001: Generate username within SimpleAuthenticationProvider if n…
Browse files Browse the repository at this point in the history
…o username is given.
  • Loading branch information
mike-jumper committed Jan 23, 2015
1 parent 4940f34 commit adc745d
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -66,6 +66,9 @@ public abstract class SimpleAuthenticationProvider
public UserContext getUserContext(Credentials credentials)
throws GuacamoleException {

// Get username, if any
String username = credentials.getUsername();

// Get configurations
Map<String, GuacamoleConfiguration> configs =
getAuthorizedConfigurations(credentials);
Expand All @@ -83,7 +86,12 @@ public UserContext getUserContext(Credentials credentials)
tokenFilter.filterValues(config.getParameters());

// Return user context restricted to authorized configs
return new SimpleUserContext(credentials.getUsername(), configs);
if (username != null)
return new SimpleUserContext(username, configs);

// If there is no associated username, let SimpleUserContext generate one
else
return new SimpleUserContext(configs);

}

Expand Down

0 comments on commit adc745d

Please sign in to comment.