Skip to content
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

Merged
merged 9 commits into from
Mar 5, 2020
Merged

Oauth 4 okta #112

merged 9 commits into from
Mar 5, 2020

Conversation

bretterer
Copy link
Collaborator

Adding Oauth for Okta!

README.md Outdated Show resolved Hide resolved
Copy link

@aarongranick-okta aarongranick-okta left a 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]

@bretterer
Copy link
Collaborator Author

  • 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://

Yes, this is common. There is a config for disabling HTTPS checks you can use for testing purposes when local.

@bretterer bretterer merged commit 3d54df2 into master Mar 5, 2020
@bretterer bretterer deleted the oauth_4_okta branch March 5, 2020 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants