PHP OAuth Client for SteemConnect - Token Refresh and Token Encoding/Decoding

in #utopian-io7 years ago (edited)
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?



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Hey @hernandev! Thank you for the great work you've done!

We're already looking forward to your next contribution!

Fully Decentralized Rewards

We hope you will take the time to share your expertise and knowledge by rating contributions made by others on Utopian.io to help us reward the best contributions together.

Utopian Witness!

Vote for Utopian Witness! We are made of developers, system administrators, entrepreneurs, artists, content creators, thinkers. We embrace every nationality, mindset and belief.

Want to chat? Join us on Discord https://discord.me/utopian-io

Thank you for your contribution.

Few points which should be taken care, in your post is about the template. It would be good if you can provide information about - What is the project about, Technology Stack, Roadmap, How to contribute in all your posts then it would be good.


Need help? Write a ticket on https://support.utopian.io.
Chat with us on Discord.

[utopian-moderator]

Updated with the roadmap, how to contribute and project description.

Also updated the title, which includes the PHP reference and the about section includes the info on it being a league provider compliant implementation, meaning the tech stack is pretty much covered.

Thank you for you work on moderation and the feedback on it's content.