Checklist
Describe the problem you'd like to have solved
If I follow the documented implementation it is not until the first request with Bearer token hits a backend API that the getDiscovery() is executed.
If we're running behind a network proxy and there is a delay on executing this request this leaves the user frustrated. It would be great to be able to execute discovery phase BEFORE starting express app which means that the application has the JWKS and openid-configuration already when the first request hits.
Describe the ideal solution
Provide the ability to execute discovery before the first request.
Alternatives and current workarounds
A hacky workaround like so works:
const auth0 = auth(auth0Opts);
try {
await auth0({
is() { return false; },
get(val) {
if (val === 'Host') {
return 'localhost';
}
return undefined;
},
headers: {
Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IndoYXRldmVyIn0=.eyJhIjoiYiJ9.dGVzdA=='
},
protocol: 'https',
originalUrl: '/api',
method: 'GET'
}, {}, () => { });
} catch {
// Do nothing. However, this doesn't actually throw.
}
Additional context
No response
Checklist
Describe the problem you'd like to have solved
If I follow the documented implementation it is not until the first request with Bearer token hits a backend API that the getDiscovery() is executed.
If we're running behind a network proxy and there is a delay on executing this request this leaves the user frustrated. It would be great to be able to execute discovery phase BEFORE starting express app which means that the application has the JWKS and openid-configuration already when the first request hits.
Describe the ideal solution
Provide the ability to execute discovery before the first request.
Alternatives and current workarounds
A hacky workaround like so works:
Additional context
No response