mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 13:17:41 +00:00
GUACAMOLE-5: Provide most recent Credentials to updateUserContext(). Doing otherwise relies on the AuthenticatedUser being updated, which is not guaranteed to happen.
This commit is contained in:
@@ -183,7 +183,7 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
|
||||
|
||||
@Override
|
||||
public UserContext updateUserContext(UserContext context,
|
||||
AuthenticatedUser authenticatedUser)
|
||||
AuthenticatedUser authenticatedUser, Credentials credentials)
|
||||
throws GuacamoleException {
|
||||
|
||||
// Ignore auth attempts if no auth provider could be loaded
|
||||
@@ -193,7 +193,7 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
|
||||
}
|
||||
|
||||
// Delegate to underlying auth provider
|
||||
return authProvider.updateUserContext(context, authenticatedUser);
|
||||
return authProvider.updateUserContext(context, authenticatedUser, credentials);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -288,6 +288,10 @@ public class AuthenticationService {
|
||||
* The AuthenticatedUser that has successfully authenticated or re-
|
||||
* authenticated.
|
||||
*
|
||||
* @param credentials
|
||||
* The Credentials provided by the user in the most recent
|
||||
* authentication attempt.
|
||||
*
|
||||
* @return
|
||||
* A List of all UserContexts associated with the given
|
||||
* AuthenticatedUser.
|
||||
@@ -296,7 +300,8 @@ public class AuthenticationService {
|
||||
* If an error occurs while creating or updating any UserContext.
|
||||
*/
|
||||
private List<UserContext> getUserContexts(GuacamoleSession existingSession,
|
||||
AuthenticatedUser authenticatedUser) throws GuacamoleException {
|
||||
AuthenticatedUser authenticatedUser, Credentials credentials)
|
||||
throws GuacamoleException {
|
||||
|
||||
List<UserContext> userContexts = new ArrayList<UserContext>(authProviders.size());
|
||||
|
||||
@@ -309,7 +314,7 @@ public class AuthenticationService {
|
||||
|
||||
// Update existing UserContext
|
||||
AuthenticationProvider authProvider = oldUserContext.getAuthenticationProvider();
|
||||
UserContext userContext = authProvider.updateUserContext(oldUserContext, authenticatedUser);
|
||||
UserContext userContext = authProvider.updateUserContext(oldUserContext, authenticatedUser, credentials);
|
||||
|
||||
// Add to available data, if successful
|
||||
if (userContext != null)
|
||||
@@ -379,7 +384,7 @@ public class AuthenticationService {
|
||||
|
||||
// Get up-to-date AuthenticatedUser and associated UserContexts
|
||||
AuthenticatedUser authenticatedUser = getAuthenticatedUser(existingSession, credentials);
|
||||
List<UserContext> userContexts = getUserContexts(existingSession, authenticatedUser);
|
||||
List<UserContext> userContexts = getUserContexts(existingSession, authenticatedUser, credentials);
|
||||
|
||||
// Update existing session, if it exists
|
||||
String authToken;
|
||||
|
Reference in New Issue
Block a user