oidc-client-ts
oidc-client-ts copied to clipboard
Add support to define JsonService timeout
Given the following use case:
- App starts
- User is not logged in
- A signin silent with iframe is triggered (and awaited because if it fails, user won't be allowed to go further)
- Down the road a call to
metadataService._getMetadataProperty("authorization_endpoint")
is made - Then a call to
jsonService.fetchWithTimeout()
From there, if the identity provider is not reachable, the fetch
call will timed out only after 90s (depends on web browser implementation). But because 3. was awaited, the app is also frozen for 90s - nothing happens, maybe a white screen, and user is left in the unknown..
In such a case it would be nice to be able to define the timeout ourselves, to reduce the awaiting time.
(something like silentRequestTimeoutInSeconds
)
not sure if that is easily possible: within _getMetadataProperty
we do not know that we are in the silent renew context...
I was more thinking about a global setting instead of one specifically designed for the silent renew.
Something generic, like : requestTimeoutInSeconds
.
What do you think ?
What do you think ?
We can do so if it help you.
I had a stab at this in #1430. Is this along the lines that you were thinking?