private void parseUserInfo(String userInfo, 
            GuacamoleConfiguration config)
            throws GuacamoleException {

        Matcher userinfoMatcher = userinfoPattern.matcher(userInfo);

        if (userinfoMatcher.matches()) {
            String username = userinfoMatcher.group(USERNAME_GROUP);
            String password = userinfoMatcher.group(PASSWORD_GROUP);

            if (username != null && !username.isEmpty() && paramIsAllowed("username")) {
                try {
                    config.setParameter("username",
                            URLDecoder.decode(username, "UTF-8"));
                }
                catch (UnsupportedEncodingException e) {
                    throw new GuacamoleServerException("Unexpected lack of UTF-8 encoding support.", e);
                }
            }

            if (password != null && !password.isEmpty() && paramIsAllowed("password")) {
                try {
                    config.setParameter("password",
                            URLDecoder.decode(password, "UTF-8"));
                }
                catch (UnsupportedEncodingException e) {
                    throw new GuacamoleServerException("Unexpected lack of UTF-8 encoding support.", e);
                }
            }
        }

    }
Parse the given string for username and password values, and, if values
are present and allowed by the configuration, decode them and set them in
the provided GuacamoleConfiguration object.

@param userInfo
    The string to parse for username/password values.

@param config
    The GuacamoleConfiguration object to store the username
    and password in.

@throws GuacamoleException
    If Java unexpectedly lacks UTF-8 support.
extensions/guacamole-auth-quickconnect/src/main/java/org/apache/guacamole/auth/quickconnect/utility/QCParser.java