-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Panic on requests with private key auth when DPoP is disabled #461
Comments
Hi @duytiennguyen-okta
|
@ArikWiz do you have the log? My guess is it panic because it couldn't get the accessToken |
thank you for the quick response it is a nil pointer deref:
and the backtrace is:
|
@ArikWiz Sorry I mean do you have log for the API call? I want to know why dpop works but bearer doesn't because I have tested both case. Line 335 should also catch if there is error when getting the accessToken, Dpop or Bearer |
Close with #466 |
Describe the bug?
With SDK version 4.1.0, every second call to API results in panic.
The root cause: https://github.com/okta/okta-sdk-golang/pull/454/files#diff-9f03089e1a25ed798b9db4fd587bb8a9a4f94eca8df0234aef9ac2b6f298b02cR197
in
Authorize
, nil value for key is received fromgetAccessTokenForPrivateKey
(I assume, that only happens when dpop is disabled, which is my case). This value is then stored in cache, just like the emptynonce
.On next call, nil
privateKey
value is retrieved from cache and provided togenerateDpopJWT
, which causes code to panic.So, there are two issues actually:
What is expected to happen?
Subsequent calls to API methods work, just like in previous version
What is the actual behavior?
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x1016886d8]
goroutine 57 [running]:
github.com/okta/okta-sdk-golang/v4/okta.generateDpopJWT(0x0, {0x1030071c0, 0x3}, {0x1400026e180, 0x25}, {0x0, 0x0}, {0x14000c86387, 0x34e})
Reproduction Steps?
In my case it was users listing with pagination that broke everything.
Additional Information?
No response
Golang Version
go version go1.21.3 darwin/arm64
SDK Version
v4.1.0
OS version
No response
The text was updated successfully, but these errors were encountered: