-
Notifications
You must be signed in to change notification settings - Fork 142
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
Oauth 4 okta #112
Oauth 4 okta #112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not able to run the unit tests unless I provided additional config either through environment variables or through an ~/okta/okta.yaml or .okta.yaml file in tests/unit. This is unexpected. The unit tests should hard code the values they need and not require external configuration or make any live network requests. For live tests using "real" configuration values, we should use the integration tests instead.
Regarding configuration, I found a few unexpected things:
- scopes must be specified as an array in the yaml, otherwise there will be an error parsing yaml and it will (silently) fail. It would be helpful if an error parsing yaml was printed. (I added fmt.Println(err.Error()) to help myself diagnose this
- The okta.yaml file in the current project directory is ".okta.yaml" not ".okta/okta.yaml" , despite what the README says. I think the README should be updated to match the current behavior, which is consistent with the other SDKs.
- It seems that "token" is a required configuration value even if authorization mode is PrivateKey
- It is requiring my oktaOrg to begin with https://. Is this consistent with other SDKs? It makes sense from an end-user perspective but local rain is typically on http://
Once I passed the configuration hurdles I received an error:
--- FAIL: Test_private_key_request_contains_bearer_token (0.61s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x38 pc=0x13ef373]
Yes, this is common. There is a config for disabling HTTPS checks you can use for testing purposes when local. |
Adding Oauth for Okta!