PHP OAuth Client for SteemConnect - Token Refresh and Token Encoding/Decoding
What is the project about?
This project allows an easy and smooth integration of SteemConnect OAuth 2 flow into PHP applications.
This is the base OAuth library that empowers the SteemConnect SDK for PHP, providing the authentication flow.
Also, this project is an OAuth provider built on League OAuth Client and share the same client API as other providers, making it easy to integrate on multiple-provider applications.
New Features
- Token refresh logic.
- Token encoding/decoding helpers.
- Test refactoring.
Token Refresh.
Whenever the offline scope is requested, the issued access tokens will contain a refresh_token field.
This special token can be used to issue new access tokens, commonly, after the current access token expires.
After this release, refreshing a token can be achieved in two ways:
// using an access token instance.
$provider->refreshToken($token);
// OR
// using the refresh token string directly.
$provider->refreshTokenString($refreshTokenString);
Token encode / decode helpers.
Also, since there's a need for storing the access tokens within the session or for later usage, two helpers were added to the Provider class. They are intended for encoding an access token into JSON and decoding from JSON into an access token.
// make an access token instance into a JSON string.
$jsonToken = $provider->encodeToken($token);
// parse a token JSON string into an access token instance.
$token = $provider->decodeToken($jsonToken);
Test refactoring.
Tests were updated in order to make it simple for others to understand.
Some repeated code between tests were refactored.
Tests for the new features on this release were also created, in order to keep the library test coverage at 100%.
Extra.
Documentation (readme.md) was updated to reflect the new features.
Roadmap.
This project now is fully featured on its purpose, provide the authentication/authorization flow for SteemConnect on PHP applications.
The roadmap is basically to test for bugs and or security threats, and refactor the unit tests, even while the coverage remains complete, making tests easier to understand is always a plus in any project.
Want to contribute?
- Join the PHP discussions over the Discord PHP channel @ SteemDevs
- Contact Telegram
- Open an Issue
- Engage on the post comments.
Posted on Utopian.io - Rewarding Open Source Contributors
Leave PHP OAuth Client for SteemConnect - Token Refresh and Token Encoding/Decoding to:
Read more #utopian-io posts
Best Posts From Diego Hernandes
We have not curated any of hernandev's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Diego Hernandes
- Testing contribution one
- testing contribution testing ok ok ok
- testing title testing again
- testing title
- Pixie: IPFS integration, PHP-PM Server and Smart Browser Caching.
- Markdown-It Plugins: Proxy Image & Mixed HTML Fixer
- [codecasts/ambientum] Performance Improvements & Refactoring
- Pixie: Image/Avatar Proxy for Steem Applications.
- Steem-Verifier: Easy transaction signature verification.
- Invalid SBD unit for transfers
- [php-sodium] Bindings for detached AEAD functions
- [PHP Extension] Zodium: A libsodium OOP wrapper.
- LaravelAEAD: Advanced Encryption with Associated Data (XChacha20-Poly1305-IETF and others)
- PHP OAuth Client for SteemConnect - Token Refresh and Token Encoding/Decoding
- SteemContext: Save time switching Steem apps with this Chrome Extension!
- PHP Steem Apps with Steem Connect and Laravel - Part II: Steem Configuration and Service Provider
- PHP Steem Apps with Steem Connect and Laravel - Part I: Initial Setup
- PHP-ALPINE: Base Images; Mailparse and secp256k1 Support.
- PHP-ALPINE: Package conflicts and extension fixes.
- SteemConnect SDK for PHP [RC1] - 100% Unit Test Coverage