Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/csabapalfi/oauth-cli
🔓 Pre-auth OAuth2 APIs locally
https://github.com/csabapalfi/oauth-cli
node-module oauth2
Last synced: 11 days ago
JSON representation
🔓 Pre-auth OAuth2 APIs locally
- Host: GitHub
- URL: https://github.com/csabapalfi/oauth-cli
- Owner: csabapalfi
- Created: 2017-05-05T17:01:35.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-07T22:12:00.000Z (over 6 years ago)
- Last Synced: 2025-01-13T15:55:34.691Z (23 days ago)
- Topics: node-module, oauth2
- Language: JavaScript
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# oauth
Pre-auth OAuth2 APIs locally
...then request/refresh access tokens easily
## why?
I have some personal scripts that need to interact with OAuth2 APIs for a single user.
## usage
### register your app
* create/register an app with your API provider of choice
* set callback URL to `http://localhost:8080`### configure the module
* drop endpoints, client id and secret, etc in options
* you can pre-configure previously acquired auth code and tokens### single function to call
* returns access token (and auth code, refresh token, token expiry)
* requests auth code (if not pre-configured)
* starts local server for auth code callback
* opens your browser with the approve URL
* requests or refreshes access token (if not pre-configured or expired)### some examples
* [Monzo](examples/monzo.js)
* [FreeAgent](examples/freeagent.js)
* [Google](examples/google.js)
* [Facebook](examples/facebook.js) (no refresh tokens, needs manual re-auth)
* TransferWise (coming soon...)