public String processUsername(JwtClaims claims) throws GuacamoleException {
        String usernameClaim = confService.getUsernameClaimType();

        if (claims != null) {
            try {
                // Pull username from claims
                String username = claims.getStringClaimValue(usernameClaim);
                if (username != null)
                    return username;
            }
            catch (MalformedClaimException e) {
                logger.info("Rejected OpenID token with malformed claim: {}", e.getMessage());
                logger.debug("Malformed claim within received JWT.", e);
            }

            // Warn if username was not present in token, as it likely means
            // the system is not set up correctly
            logger.warn("Username claim \"{}\" missing from token. Perhaps the "
                    + "OpenID scope and/or username claim type are "
                    + "misconfigured?", usernameClaim);
        }

        // Could not retrieve username from JWT
        return null;
    }
Parses the given JwtClaims, returning the username contained
therein, as defined by the username claim type given in
guacamole.properties. If the username claim type is missing or 
is invalid, null is returned.

@param claims
    A valid JwtClaims to extract the username from.

@return
    The username contained within the given JwtClaims, or null if the
    claim is not valid or the username claim type is missing,

@throws GuacamoleException
    If guacamole.properties could not be parsed.
extensions/guacamole-auth-sso/modules/guacamole-auth-sso-openid/src/main/java/org/apache/guacamole/auth/openid/token/TokenValidationService.java