-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hi,
Thank you for your code it has provided great use to me! However, I have found a bug in src/OneLoginClient/OneLoginClient.cs.
Summary
My script uses this OneLoginClientDotNet package. It runs every hour. A 'NullReferenceException' is raised every 10 hours.
The code failure occurs inside src/OneLoginClient/OneLoginClient.cs:
- The NullReferenceException is raised on line 97 (
nextLink = result.Pagination.NextLink;) within theGetNextPagesfunction - This is because the access token, used by the client to make an API call to OneLogin, expires every 10 hours and the same access token is still used until the http request returns a 'forbidden' response. This is described here.
- On line 95 (
var result = await GetResource<T>(nextLink);), the code generates an expired token after 10 hours. - This forbids access for the client to OneLogin, which is shown by the 'forbidden' response (401) from OneLogin in the
ParseHttpResponse()function - This returns a null
var resultand causes the NullReferenceException to be thrown. - My script then fails due to the NullReferenceException and stops running. It is then automatically rerun by kubernetes and the script runs fine as a new access token is generated.
What is the current bug behavior?
A NullReferenceException is raised every 10 hours due to access token expiring
What is the expected correct behavior?
A new token would be generated every 9-10 hours before the access token expires to avoid the Exception being thrown.
Metadata
Metadata
Assignees
Labels
No labels