public boolean isValid(String nonce) {

        // All null nonces are invalid.
        if (nonce == null)
            return false;

        // Remove nonce, verifying whether it was present at all
        Long expires = nonces.remove(nonce.toLowerCase(Locale.US));
        if (expires == null)
            return false;

        // Nonce is only valid if it hasn't expired
        return expires > System.currentTimeMillis();

    }
Returns whether the give nonce value is valid. A nonce is valid if and
only if it was generated by this instance of the NonceService. Testing
nonce validity through this function immediately and permanently
invalidates that nonce.

@param nonce
    The nonce value to test. This value may be null, which will be
    considered an invalid nonce. Comparisons are case-insensitive.

@return
    true if the provided nonce is valid, false otherwise.
extensions/guacamole-auth-sso/modules/guacamole-auth-sso-base/src/main/java/org/apache/guacamole/auth/sso/NonceService.java