Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ngerakines/oacp
OAuth Callback Proxy
https://github.com/ngerakines/oacp
Last synced: about 1 month ago
JSON representation
OAuth Callback Proxy
- Host: GitHub
- URL: https://github.com/ngerakines/oacp
- Owner: ngerakines
- License: mit
- Created: 2020-01-07T15:12:17.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-01-07T20:14:44.000Z (almost 5 years ago)
- Last Synced: 2024-05-01T13:43:27.174Z (8 months ago)
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OAuth Callback Proxy (oacp)
`oacp` is a proxy used to redirect requests by the state query string parameter.
# Operation
First, run the server. By default, local storage (in memory) is used.
$ oacp server
Next, register state/location pairs using the API.
$ oacp record --server http://localhost:5000 --state foo --location https://www.google.com/
OR
$ curl -vv -F "state=foo" -F "location=https://www.google.com/" "http://aocp:aocp@localhost:5000/api/locations"
Last, the callback will redirect as configured.
$ curl -vv "http://localhost:5000/callback?state=foo&code=what"
> GET /callback?state=foo&code=what HTTP/1.1
> Host: localhost:5000
> User-Agent: curl/7.59.0
> Accept: */*
>
< HTTP/1.1 302 Found
< Content-Type: text/html; charset=utf-8
< Location: https://www.google.com/
< Date: Tue, 07 Jan 2020 17:45:09 GMT
< Content-Length: 46
<
Found.**Note**: State tokens are expected to be unique and one-time-use only. Once a state is used, it is removed from storage and cannot be used again.