code: public static String findMatchingRedirectUri(Collection<String> redirectUris, String requestedRedirectUri, String fallbackRedirectUri) {
          AntPathMatcher matcher = new AntPathMatcher();
  
          for (String pattern : ofNullable(redirectUris).orElse(emptyList())) {
              if (matcher.match(pattern, requestedRedirectUri)) {
                  return requestedRedirectUri;
              }
          }
  
          return ofNullable(fallbackRedirectUri).orElse(requestedRedirectUri);
      }
docs: Finds and returns a matching redirect URL according to the following logic:
  <ul>
  <li>If the requstedRedirectUri matches the whitelist the requestedRedirectUri is returned</li>
  <li>If the whitelist is null or empty AND the fallbackRedirectUri is null, the requestedRedirectUri is returned - OPEN REDIRECT</li>
  <li>If the whitelist is null or empty AND the fallbackRedirectUri is not null, the fallbackRedirectUri is returned</li>
  </ul>
  
  @param redirectUris         - a whitelist collection of ant path patterns
  @param requestedRedirectUri - the requested redirect URI, returned if whitelist matches or the fallbackRedirectUri is null
  @param fallbackRedirectUri  - returned if non null and the requestedRedirectUri doesn't match the whitelist redirectUris
  @return a redirect URI, either the requested or fallback as described above