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

Add auth exception handling for expired token #1334

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Conversation

LeiGlobus
Copy link
Contributor

Description

When an user runs an endpoint command and the refresh token is expired (> 6 months old), the CLI exists with a cryptic invalid_grant error message which is confusing. See Story https://app.shortcut.com/funcx/story/27972/display-better-error-message-when-refresh-token-is-expired-on-endpoint-commands

We catch these errors in normal auth pathways when registering endpoints, but the crux is that GET /v2/version fails auth, even though the token isn't required. The Globus SDK always verifies the token if it exists, before the request is sent to the endpoint(which may be a public endpoint that does not care about tokens).

Slack discussion: https://funcx.slack.com/archives/C016JMYST9C/p1697729426325119

Ideally, we want to give more clear information to the user. But in this PR I stopped short of clearing the token ourselves via logout(), as that clears tokens from all environments and may be a destructive path. Better to suggest instead?

Type of change

  • New feature (non-breaking change that adds functionality)
  • Documentation update

@LeiGlobus LeiGlobus added no-news-is-good-news This change does not require a news file quick-review Review of this should be quick and easy labels Oct 23, 2023
@LeiGlobus LeiGlobus self-assigned this Oct 23, 2023
Copy link
Contributor

@joshbryan-globus joshbryan-globus left a comment

Choose a reason for hiding this comment

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

LGTM

khk-globus
khk-globus previously approved these changes Oct 23, 2023
@LeiGlobus LeiGlobus dismissed stale reviews from khk-globus and joshbryan-globus via 98bdefc October 23, 2023 19:49
@LeiGlobus LeiGlobus force-pushed the auth_grant_error branch 3 times, most recently from b6b4f78 to d89b3cf Compare October 23, 2023 19:57
khk-globus
khk-globus previously approved these changes Oct 23, 2023
Copy link
Contributor

@khk-globus khk-globus left a comment

Choose a reason for hiding this comment

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

OMG. We. Got. There. Heh.

@LeiGlobus LeiGlobus merged commit 3e75b90 into main Oct 23, 2023
30 checks passed
@LeiGlobus LeiGlobus deleted the auth_grant_error branch October 23, 2023 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-news-is-good-news This change does not require a news file quick-review Review of this should be quick and easy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants