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

CLI deciding if token exchange needed should not look at ID token expiry #1873

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

cfryanr
Copy link
Member

@cfryanr cfryanr commented Feb 22, 2024

While trying to reproduce the issue reported in #1868, I found an issue that was caused by PR #1864.

This PR fixes a small mistake in PR #1864. When the "pinniped login oidc" CLI command is deciding if the RFC8693 token exchange is needed, it should not look at the expiry of the ID token. This mistake would cause the RFC8693 token exchange to happen when the OIDC provider is not a Pinniped Supervisor, which would fail because most other providers do not support that type of token exchange.

It does not matter if the current ID token is close to expiring when deciding if the RFC8693 token exchange is needed, because the token exchange is going to yield a new ID token anyway. However, it does matter if the current ID token is close to expiring if the CLI decides that it is not going to perform the token exchange, and this PR does not change that logic.

This PR also adds a new hack script to make it easy to set up a local kind cluster to manually test the style of configuration which was impacted by this bug. It configures the Concierge to use an OIDC issuer which is not the Pinniped Supervisor.

This PR also updates the documentation related to using the Concierge with an OIDC issuer which is not the Supervisor to clarify some points. Rendered preview here.

Release note:

None because #1864 has not been included in any release yet.

NONE

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 38.12%. Comparing base (216fce7) to head (64b0e69).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1873      +/-   ##
==========================================
- Coverage   38.13%   38.12%   -0.01%     
==========================================
  Files         346      346              
  Lines       43630    43628       -2     
==========================================
- Hits        16638    16634       -4     
- Misses      26477    26479       +2     
  Partials      515      515              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This fixes a small mistake in PR #1864. When the "pinniped login oidc"
CLI command is deciding if the RFC8693 token exchange is needed, it
should not look at the expiry of the ID token. This mistake would cause
the RFC8693 token exchange to happen when the OIDC provider is not
a Pinniped Supervisor, which would fail because most other providers
do not support that type of token exchange.

It does not matter if the current ID token is close to expiring when
deciding if the RFC8693 token exchange is needed, because the token
exchange is going to yield a new ID token anyway. It does matter if the
current ID token is close to expiring if the CLI decides that it is
not going to perform the token exchange, and this commit does not change
that logic.
Copy link
Member

@benjaminapetersen benjaminapetersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@cfryanr cfryanr merged commit 40e548e into main Feb 23, 2024
39 checks passed
@cfryanr cfryanr deleted the 1864_followup branch February 23, 2024 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants