The [ClearRealmCache API](https://www.elastic.co/guide/en/elasticsearch/reference/current/security-api-clear-cache.html) evicts users from caching realms. It should also clear the [lastSuccessfulAuthCache](https://github.com/elastic/elasticsearch/blob/fcfb04392cfdf6f3ae35587ce0f4ed6522cef05a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/AuthenticationService.java#L97) in the process. 

But it fails to do that if the realm is specified as a wildcard, i.e. the following request clear all realm caches, but not the lastSuccessfulAuthCache ([relevant code](https://github.com/elastic/elasticsearch/blob/fcfb04392cfdf6f3ae35587ce0f4ed6522cef05a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/realm/TransportClearRealmCacheAction.java#L85-L90)):

```
POST _security/realm/*/_clear_cache
```

But it does clear lastSuccessfulAuthCache if concrete realm name is specified, e.g. the following request clear both the reserved realm cache and the lastSuccessfulAuthCache ([relevant code](https://github.com/elastic/elasticsearch/blob/fcfb04392cfdf6f3ae35587ce0f4ed6522cef05a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/realm/TransportClearRealmCacheAction.java#L92-L100)):

```
POST _security/realm/reserved/_clear_cache
```

#### Steps to reproduce the issue
1. Enable both file and native realm on a node and make sure file is before native in the realm chain
2. Create a native user `foo` and authenticate with it.
3. Add a file user `foo` with the same password and wait for the node to auto-load the file
4. Clear realm cache with `POST _security/realm/*/_clear_cache`
5. Authenticate with `foo`, but the realm is still `native` (_incorrect behaviour_)
6. Clear the realm cache with `POST _security/realm/reserved/_clear_cache`
7. Authenticate with `foo`, this time the realm is `file` (_correct behaviour_)

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/action/realm/TransportClearRealmCacheAction.java
clearAuthenticationServiceCache(nodeRequest.getUsernames());
        return new ClearRealmCacheResponse.Node(clusterService.localNode());
    }
    private void clearAuthenticationServiceCache(String[] usernames) {
        
        
        
        if (usernames != null && usernames.length != 0) {
            for (String username : usernames) {
                authenticationService.expire(username);
            }
        } else {
            authenticationService.expireAll();
        }
    }
    private static void clearCache(Realm realm, String[] usernames) {
        if ((realm instanceof CachingRealm) == false) {
            return;
        }
        CachingRealm cachingRealm = (CachingRealm) realm;
        if (usernames != null && usernames.length != 0) {
            for (String username : usernames) {
                cachingRealm.expire(username);
            }
        } else {
            cachingRealm.expireAll();
        }
    }
}