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

Support OpenID tokens for getting using information #122

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Commits on Jun 21, 2022

  1. Add support of OpenID providers

    With OpenID flow, instead of using /userinfo endpoint, an ID token
    issued by the authorisation server is used.
    
    Information in this token ususally includes extra params and options,
    not available in userinfo response.
    alek-sys committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    a528a70 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    242fcfc View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e3fd054 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    89969d4 View commit details
    Browse the repository at this point in the history
  5. Fix typos

    alek-sys committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    7411bff View commit details
    Browse the repository at this point in the history
  6. Cleanup

    makeRedirURL should work from a request, but it's not part of this PR
    alek-sys committed Jun 21, 2022
    Configuration menu
    Copy the full SHA
    8026918 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2022

  1. Only generate private key if OpenID is enabled

    Key generation is slow(-ish) so usual sleeps of 50ms sometimes not
    enough, that makes tests flaky.
    alek-sys committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    e5a20c7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ab93f7d View commit details
    Browse the repository at this point in the history
  3. Make sure AddDevOpenIDProvider is called in auth_test.go

    Weirdly coveralls thinks this method is not covered, because it is
    tested in another package. However there isn't much to test really, so
    at best I can check jwks URL is correctly served.
    alek-sys committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    41a0ffe View commit details
    Browse the repository at this point in the history
  4. Add auth tests

    Actual login flow is tested already, and these two new methods are
    called in provider/openid_test.go. However the coverage tool is not
    detecting these calls, and instead seems to be requiring the methods to
    be called in the matching test file.
    
    So this test is a weird artifact to make coverage tool happy.
    alek-sys committed Jun 22, 2022
    Configuration menu
    Copy the full SHA
    9de085f View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2022

  1. Fix token validation and update README

    golang-jwt library is trying to validate iat claim of the ID token and
    due to not accounting for clock skew, validation pretty randomly fails.
    
    There is an open issue golang-jwt/jwt#98 and
    seems like that is fixed in v4. However it is still unclear why iat is
    validation in the first place, that's not required by RFC and doesn't
    seem like the right thing to do. Only nbf and exp claims should be used
    for token lifetime validity check.
    
    Also, update README to show how to configure OpenID providers.
    alek-sys committed Jun 24, 2022
    Configuration menu
    Copy the full SHA
    28a499c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d6b8f26 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2022

  1. Tidy up

    alek-sys committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    3bf3b62 View commit details
    Browse the repository at this point in the history