return error when access token request failed to avoid using null access tokens
Summary
Currently empty access tokens could be submitted to OKTA that leads to failed requests with uncertain reasons.
This happens when access token request completed with non-OK status code.
This PR fixes this behaviour by retuning an error with proper error descriptions instead of returning a null access token which is invalid obviously.
Fixes N/A
Type of PR
[x] Bug Fix (non-breaking fixes to existing functionality)
[ ] New Feature (non-breaking changes that add new functionality)
[ ] Documentation update
[ ] Test Updates
[ ] Other (Please describe the type)
Test Information
[ ] My PR required test updates
Go Version: 1.21.6
Os Version: MacOS 12.3 (Kernel Version 21.4.0)
OpenAPI Spec Version:
Signoff
[x] I have submitted a CLA for this PR
[x] Each commit message explains what the commit does
[x] I have updated documentation to explain what my PR does
[ ] My code is covered by tests if required
[x] I ran make fmt on my code
[x] I did not edit any automatically generated files
return error when access token request failed to avoid using null access tokens
Summary
Currently empty access tokens could be submitted to OKTA that leads to failed requests with uncertain reasons. This happens when access token request completed with non-OK status code.
This PR fixes this behaviour by retuning an error with proper error descriptions instead of returning a null access token which is invalid obviously.
Fixes N/A
Type of PR
Test Information
Go Version: 1.21.6 Os Version: MacOS 12.3 (Kernel Version 21.4.0) OpenAPI Spec Version:
Signoff
make fmt
on my code