private Mono<AuthenticationResult> acquireAccessTokenFromRefreshToken(String resource, String refreshToken, boolean isMultipleResourceRefreshToken) {
        String authorityUrl = this.environment().activeDirectoryEndpoint() + this.domain();
        ExecutorService executor = Executors.newSingleThreadExecutor();
        Mono<AuthenticationResult> authMono = Mono.defer(() -> {
            AuthenticationContext context;
            try {
                context = new AuthenticationContext(authorityUrl, false, executor);
            } catch (MalformedURLException mue) {
                throw Exceptions.propagate(mue);
            }
            if (proxy() != null) {
                context.setProxy(proxy());
            }
            return Mono.create(callback -> context.acquireTokenByRefreshToken(
                    refreshToken,
                    clientId(),
                    resource,
                    Util.authenticationDelegate(callback)));
        });
        return authMono.doFinally(s -> executor.shutdown());
    }
private Mono < AuthenticationResult > acquireAccessTokenFromRefreshToken ( String resource , String refreshToken , boolean isMultipleResourceRefreshToken ) { String authorityUrl = this . environment ( ) . activeDirectoryEndpoint ( ) + this . domain ( ) ; ExecutorService executor = Executors . newSingleThreadExecutor ( ) ; Mono < AuthenticationResult > authMono = Mono . defer ( ( ) -> { AuthenticationContext context ; try { context = new AuthenticationContext ( authorityUrl , false , executor ) ; } catch ( MalformedURLException mue ) { throw Exceptions . propagate ( mue ) ; } if ( proxy ( ) != null ) { context . setProxy ( proxy ( ) ) ; } return Mono . create ( callback -> context . acquireTokenByRefreshToken ( refreshToken , clientId ( ) , resource , Util . authenticationDelegate ( callback ) ) ) ; } ) ; return authMono . doFinally ( s -> executor . shutdown ( ) ) ; }
Refresh tokens are currently not used since we don't know if the refresh token has expired