This library is insipred by https://github.com/slugonamission/OAuth2 but aims to add extra missing functionality like access token refresh, state saving, response caching, etc. The project is working and API changes are not extpected though this is not a guarantee.
Note that for the full functionality it is expected you use some other library to extract the code from the redirect uri. It is recommended to use my scheme registering and handling library however, other awesome options exist.
libschemehandler: Lightweight scheme registering and handling library with no extra dependencies (LICENSE MIT)
Ultralight: Lightweight and powerfull embeded browser library (formerly awesomium) (TRIPLE LICENSE)
libmicrohttpd: Lightweight and simple HTTP server library written in ansi C and perfect for embedded systems (LICENSE GPL-3)
- Syncronous API requests with request caching.
- Compatibility with my URI scheme handler.
- Supports all major API request types (PUT, PATCH, POST, GET, DELETE...)
- State saving of "tokens" and configuration variables (simple .ini file)
- Auto refresh "access token" with zero overhead for the user.
- Cross-compatibility with Windows/Apple/Linux
- The response code and content type (as well as the response data) are returned.
- Custom cache data structure with cache saving between sessions.
- Async request support for the same oauth module with the same client_id.
- Optional per request configurations (cached, async and authed)
- Handling on auth callback different than application/json (AKA XML)
Any contribution is welcome and should be done through a pull request. Currently help is mostly needed with documentation and general bugfixing. Also standarization and cleanup of libutils would be nice. Any comments on how to make the project faster and/or cleaner are also very welcome.
Credit goes to:
Rafa Garcia from https://github.com/rafagafe/tiny-json
Ozan Tezcan from https://github.com/tezc/sc
Rodion Efremov from https://github.com/coderodde/coderodde.c.utils
for their amazing libraries.