mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
GUACAMOLE-839: Ensure all SSO and related mechanisms set Credentials username.
This is necessary to ensure the ${GUAC_USERNAME} token is properly substituted in cases where SSO and SSO-like auth methods are used.
This commit is contained in:
@@ -60,14 +60,17 @@ public class SSOAuthenticatedUser extends AbstractAuthenticatedUser {
|
||||
|
||||
/**
|
||||
* Initializes this SSOAuthenticatedUser, associating it with the given
|
||||
* username, credentials, groups, and parameter tokens. This function must
|
||||
* be invoked for every SSOAuthenticatedUser created.
|
||||
* username, credentials, groups, and parameter tokens. The contents of the
|
||||
* given credentials are automatically updated to match the provided
|
||||
* username. This function must be invoked for every SSOAuthenticatedUser
|
||||
* created.
|
||||
*
|
||||
* @param username
|
||||
* The username of the user that was authenticated.
|
||||
*
|
||||
* @param credentials
|
||||
* The credentials provided when this user was authenticated.
|
||||
* The credentials provided when this user was authenticated. These
|
||||
* credentials will be updated to match the provided username.
|
||||
*
|
||||
* @param effectiveGroups
|
||||
* The groups that the authenticated user belongs to.
|
||||
@@ -78,10 +81,16 @@ public class SSOAuthenticatedUser extends AbstractAuthenticatedUser {
|
||||
*/
|
||||
public void init(String username, Credentials credentials,
|
||||
Set<String> effectiveGroups, Map<String, String> tokens) {
|
||||
|
||||
this.credentials = credentials;
|
||||
this.effectiveGroups = Collections.unmodifiableSet(effectiveGroups);
|
||||
this.tokens = Collections.unmodifiableMap(tokens);
|
||||
setIdentifier(username);
|
||||
|
||||
// Update credentials with username provided via SSO for sake of
|
||||
// ${GUAC_USERNAME} token
|
||||
credentials.setUsername(username);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user