Repository navigation
Dedicated authentication command #1413
Description
Activity
Designs
gh auth login
gh auth logout
gh auth status
gh auth refresh
$ gh auth refresh --scope [list]@vilmibm let me know if you need more input on the flags language, I'm cool with you taking a pass at it and I can give feedback!
- addedauthrelated to tokens, authentication state, or oauthrelated to tokens, authentication state, or oauth
on Jul 27, 2020 Re: “Login using the browser” prompt: I'm not sure if we give the user enough information to make a decision at this point; i.e. we don't present any alternatives to the user until they choose "no". Maybe it would be useful to present all possible options at once?
I think it's important for the user to understand that if they choose to not login using the browser, they need to already have an authentication token ready. They might expect that skipping the browser will prompt them for username+password on the command line (a la hub), but I would want us to somehow communicate that this mode of authentication is not available, even though it's frequently asked for.
Proposed flow:
? Choose your authentication method: Log in using a web browser > Paste an authentication token Tip: you can generate a Personal Access Token here https://github.com/settings/tokens The minimum required scopes are `repo` and `read:org`. ? Paste your authentication token: *************@ampinsk What do you think?
@mislav the same thing occurred to me and I went with this copy yesterday, thoughts?
That looks great!
Nit: I don't think we need to say "OAuth" since that's an implementation detail.
Yes thank you both for bringing this up, this is so much clearer 🙇♀️
The copy @mislav proposed above made a little more sense to me at a glance. I also really like the tip! 🤩
Reacted by Nate Smith




Example use:
As I see it, these would be its broader set of features:
triggers authentication for a specific GitHub host and caches credentials to
hosts.ymlverifies current credentials (either that from GITHUB_TOKEN or from
hosts.yml)offers way to re-auth No CTA after mistaken deletion of oauth access #627 How to switch user aka. logout and sign in? #887
gh apipurposes)longer-term: support multiple logged-in accounts to the same host Allow multiple account credentials #326
Subcommands:
/cc @ampinsk