https://github.com/dagit/twitch_oauth
Simple Rust example of oauth with twitch
https://github.com/dagit/twitch_oauth
oauth2 oauth2-client rust twitch twitch-api twitch-bot
Last synced: 10 months ago
JSON representation
Simple Rust example of oauth with twitch
- Host: GitHub
- URL: https://github.com/dagit/twitch_oauth
- Owner: dagit
- Created: 2020-05-10T20:51:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-15T20:58:20.000Z (about 6 years ago)
- Last Synced: 2024-12-31T04:41:58.882Z (over 1 year ago)
- Topics: oauth2, oauth2-client, rust, twitch, twitch-api, twitch-bot
- Language: Rust
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# twitch_oauth
Simple Rust example of oauth with twitch
# Usage
1. Register an app at dev.twitch.tv
1. Put your client-id into a file named, `client-id`
1. Put your client-secret into a file named, `client-secret`
1. `cargo run` this program in the same directory as your client-id and client-secret
1. The program will print a URL, paste that into your browser. Note: You may need to use a private browsing window to avoid a CSRF error. You will also need to open port 8080 to receive the redirect from twitch.
1. The program will make one more HTTP POST, if that is successful it will write your new oauth token to a file named `oauth-token`.
This is just a toy sketch and not a fully fleshed out instance of how you should do this in a real application. For example, this throws away the renew code. Also it has the scope hard coded to `channel:read:redemptions`.