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

Stop requiring a configured oauth client prior to token_fetch() #186

Merged
merged 2 commits into from May 12, 2023

Conversation

jennybc
Copy link
Member

@jennybc jennybc commented May 12, 2023

Fixes #160

The basic idea is to let token_fetch() fail for someone who wants the user flow AND who has failed to configure an OAuth client. Then, in the gm_auth() error message, try to provide enough info to help that user diagnose their problem.

Previously an OAuth client was required, unconditionally, prior to calling token_fetch(). The upside is that the user who wants the user flow gets an unequivocal early error message if they haven't configured a client. And this is by far the most common use case.

But the downside is that no other auth flow can work. No BYO token, no service account, no ADC, etc. None of those even need an OAuth client, but they are currently inaccessible because of the unconditional client check. So that has to change.

Here I remove the unconditional check for an OAuth client and, instead, insert specific advice in the gm_auth() error message.

While I was working on the message, I also added advice about setting options(gargle_verbosity = "debug").

This change also makes it easier to auth with the dev/testing credentials, which uses BYO token.

@jennybc jennybc marked this pull request as ready for review May 12, 2023 21:48
@jennybc jennybc merged commit c3fee30 into main May 12, 2023
13 checks passed
@jennybc jennybc deleted the unblock-non-user-auth branch May 12, 2023 21:49
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.

Service account authentification doesn't work
1 participant