Closed eliperelman closed 6 years ago
Also note that you can override what URL you choose to fetch credentials from, as well as the underlying mechanism for fetching those credentials:
new Client({
exchangeAccessTokenUrl: String,
exchangeAccessToken: Function<String accessToken, String exchangeAccessTokenUrl> ->
Promise<Object<credentials, expires>>
});
For example:
new Client({
exchangeAccessTokenUrl:
'https://taskcluster-login.ngrok.io/v1/oidc-credentials/mozilla-auth0',
// or ignore completely, not even making a request
exchangeAccessToken: (accessToken, url) =>
Promise.resolve({ credentials: {}, expires: new Date() })
});
@djmitche ready for review again.
This would allow you to do:
So now every client will await the fetching of credentials if an accessToken is provided.