class OidcService {

    public RefreshToken exchangeAuthorizationCode(final String oidcRequestIdentifier, final AuthorizationGrant authorizationGrant) throws IOException {
        if (!isOidcEnabled()) {
            throw new IllegalStateException(OPEN_ID_CONNECT_SUPPORT_IS_NOT_CONFIGURED);
        }

        final CacheKey oidcRequestIdentifierKey = new CacheKey(oidcRequestIdentifier);
        //final String nifiJwt = identityProvider.exchangeAuthorizationCode(authorizationGrant);
        final OIDCTokens oidcTokens = exchangeOIDCToken(authorizationGrant);
        final RefreshToken oidcRefreshToken = oidcTokens.getRefreshToken();
        final String nifiJwt = getJwtFromOIDCTokens(oidcTokens);
        try {
            // cache the jwt for later retrieval
            synchronized (jwtLookupForCompletedRequests) {
                final String cachedJwt = jwtLookupForCompletedRequests.get(oidcRequestIdentifierKey, () -> nifiJwt);
                if (!timeConstantEqualityCheck(nifiJwt, cachedJwt)) {
                    throw new IllegalStateException("An existing login request is already in progress.");
                }
            }
            return oidcRefreshToken;
        } catch (final ExecutionException e) {
            throw new IllegalStateException("Unable to store the login authentication token.");
        }
    }

    public  OidcService(final OidcIdentityProvider identityProvider);
    public  OidcService(final OidcIdentityProvider identityProvider, final int duration, final TimeUnit units);

}