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

sso: okta provider MVP #174

Merged
merged 1 commit into from
Apr 24, 2019
Merged

Conversation

Jusshersmith
Copy link
Contributor

@Jusshersmith Jusshersmith commented Apr 3, 2019

Okta provider integration

This implements the MVP for adding Okta as an oauth provider for SSO.
Documentation on set up of Okta resources in a separate PR: #182

This PR includes:

  • A new Okta provider (based off of the Google provider to keep them consistent where reasonable)
  • A set of tests for the Okta provider. Again, initially based off of the Google provider tests however changed/added to where necessary.
  • Changes to the options parsing layer to accommodate new settings required. (the only additional env var required that does not have a default is okta_org_url which is the URL of the org's okta domain (e.g. test.okta.com))
  • Now that we have multiple possible providers, some changes to the internal_util.go and it's tests package to separate logic into respective provider packages.
  • Minimum required changes to the google provider and google provider tests to work with the above changes to internal_util.go
  • Minimum required changes to provdider_default.go to work with the changes to internal_util.go

One notable thing missing is any group caching functionality - this will also be shipped in a separate, soon-to-come PR.

@Jusshersmith Jusshersmith force-pushed the jusshersmith-okta-provider-test branch from a491f74 to 6d26a94 Compare April 10, 2019 17:13
@Jusshersmith Jusshersmith marked this pull request as ready for review April 15, 2019 10:40
internal/auth/options.go Outdated Show resolved Hide resolved
@jphines
Copy link
Contributor

jphines commented Apr 22, 2019

@Jusshersmith this is looking really good, just a few nits about testing and arg validation!

validateToken

validateToken, groups and email

tidy validateToken

UserInfo

UserInfo continued

Might be worth splitting this function up so it can serve different
purposes if required in the future. However for now it does the job.

some cleanup and fix group validation

change default to google

cleaning up

updating comments

removng BaseURL from provider for now

removing BaseURL from options and modifying UserInfoURL and RevokeURL

fix tags

removing BaseURL from provider_data

add offline_access for refresh token

tidying

add empty line back in

separate validateToken into respective provider packages

review changes

change from oktapreview to okta

rename UserInfo to GetUserProfile

removing validateToken func and tests

extra oktapreview -> okta

add initial test file

skipping while debugging

fixing TestValidateEndpoint tests

removing skip

check response contents to properly validate

removing debug output

changes from review, and adding relevant test case

use test logger instead of stdlib logger

use %q instead of %s to quote formatted output

moving formatting to options.go, and reducing repetition

move logic to more relevant function

set entire org url rather than just org name

fixing test
@Jusshersmith Jusshersmith force-pushed the jusshersmith-okta-provider-test branch from 470925b to 5edbfbd Compare April 24, 2019 13:23
@Jusshersmith Jusshersmith changed the title sso: okta provider (WIP) sso: okta provider MVP Apr 24, 2019
@Jusshersmith Jusshersmith merged commit 49c9eba into master Apr 24, 2019
@Jusshersmith Jusshersmith deleted the jusshersmith-okta-provider-test branch April 24, 2019 16:19
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.

2 participants