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

The refresh token is not requested by the token exchange protocol even though the refresh token's presence is mandatory #902

Closed
ErvinRacz opened this issue Jan 17, 2025 · 2 comments

Comments

@ErvinRacz
Copy link
Contributor

ErvinRacz commented Jan 17, 2025

Description

The refresh token's presence is mandatory according to the current implementation. If it is not present, 401 is returned, forcing the login flow.

There are two problems:

  1. the refresh token's presence should not be mandatory for authorization
  2. the currently the refresh token is not even requested with the default configuration of Nebraska, as it misses the offline_access scope.

How authorization happens If the refresh token is mandatroy, but it is not even requested? The current implementaion checks only for nil value and doesn't check for empty string too which is held by the refresh_token key in the session map.

Impact

  1. Login flow triggered multiple times. See network tab.

Environment and steps to reproduce

  1. Set-up: Configure an IDP an run Nebraska locally:
air --build.cmd "go build -o ./bin/nebraska ./cmd/nebraska/main.go" \
         --build.bin "./bin/nebraska" \
         --build.args_bin "\
     -http-log \
     -debug \
     --auth-mode oidc \
     --oidc-admin-roles nebraska_admin \
     --oidc-viewer-roles nebraska_member \
     --oidc-roles-path \"http://kinvolk\.io/roles\" \
     --oidc-client-id _redacted_ \
     --oidc-issuer-url https://_redacted_.com/ \
     --oidc-client-secret _redacted_ \
     -oidc-valid-redirect-urls http://localhost:3000/"
  1. Task: [ describe the task performing when encountering the bug ]
  2. Action(s): Add offline_access scope to the default config. Extend if statement to check empty string. Require refresh_token only if access token has expired.
  3. Error: Absent of refresh_token, the login flow is triggered

Expected behavior

Should be able to obtain the refresh token and use it without triggering the login flow at least once.

@ErvinRacz
Copy link
Contributor Author

Will be fixed by the following PRs:
#903
#899

@ErvinRacz
Copy link
Contributor Author

both PRs have been merged:
#903, #899

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

No branches or pull requests

1 participant