Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakewilkins/gh-device-flow
GitHub Device Authorization Flow in Rust
https://github.com/jakewilkins/gh-device-flow
github-authentication github-developer rust rust-cli rust-crate
Last synced: 2 months ago
JSON representation
GitHub Device Authorization Flow in Rust
- Host: GitHub
- URL: https://github.com/jakewilkins/gh-device-flow
- Owner: jakewilkins
- License: mit
- Created: 2022-08-19T18:16:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-15T22:56:26.000Z (10 months ago)
- Last Synced: 2024-10-03T11:19:54.468Z (3 months ago)
- Topics: github-authentication, github-developer, rust, rust-cli, rust-crate
- Language: Rust
- Homepage: https://crates.io/crates/github-device-flow
- Size: 110 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
gh-device-flow
==============Crate that implements the GitHub Device Flow for authenticating with GitHub Apps.
It also implements the refresh mechanism for GitHub Apps that use GitHub's token
expiration feature.## Usage
To use the CLI, download the binary for your architecture/OS from [the latest release](https://github.com/jakewilkins/gh-device-flow/releases/latest).
Once extracted, execute the command providing the Client ID for your App:
```bash
github-device-flow --client-id Iv1.8675309ABCDEFGH
```This will prompt you to open a browser window and provide the generated device code. Once completed, your access token will be printed to STDOUT as a JSON object. If your App requests refresh tokens one will also be printed.
To refresh your OAuth Access using a Refresh Token, pass it as a `--refresh` flag:
```bash
github-device-flow --client-id Iv1.8675309ABCDEFGH --refresh thisisnotarefreshtoken
```To view the full help, pass the `--help` flag:
```
$ github-device-flow --help
github-device-flow 0.1.2
Binary and library for performing the GitHub Device FlowUSAGE:
github-device-flow [OPTIONS] --client-idOPTIONS:
-c, --client-id Client ID
-h, --host The host to authenticate with
--help Print help information
-r, --refresh A Refresh Token to exchange
-s, --scope The scope required for the auth app
-V, --version Print version information
```