Updating Steemline to work with the new Steemconnect API

in #utopian-io6 years ago

About Steemline

Steemline is a browser based app with a slick UI that makes it easy to follow what interests you on the steem network.

steemline

As I began writing this post, I noticed that @flauwy has just posted a helpful video tutorial about Steemline. Go check it out here.

About Steemconnect

Steemconnect is an authentication tool for the Steem network. The main benefit it provides is a better security / trust model. If you had to provide your password to every app built on Steem, you would be taking a large risk of your account being hacked or misused. But with Steemconnect, you only need to entrust your password (or key, etc) with just one entity. Other apps just need to request authentication tokens with Steemconnect. These tokens have limited power and can be revoked by you any time. Well atleast in version 2 of Steemconnect they can.

Version 2 of Steemconnect follows a standard model of authentication called oAuth. This is how it roughly works:

  • The user clicks a login button on app's website
  • The user is directed to https://v2.steemconnect.com/... where they can sign in and approve the app's request for authentication. A list of "permissions" required by the app is shown to the user, so that the user can make an informed decision.
  • If the user approves, then they are redirected back to the app's website.

Goal

My goal was to add Steemconnect v2 support to Steemline, to bring it in line with modern practices. Doing this was pretty easy once I got familiar with Steemline's code.

Steemline currently uses PHP for its backend. The amount of backend code is very little, and there are plans to move to full JS stack. The frontend is built in pure JS with VueJS, and there are plans to move to Typescript; but that's for a later post.

Process

  • The first step was to register an app with Steemconnect. There a nice post about it by @noisy
  • Then, I added a redirect to the Steemconnect website
  • Next was to add routes in the backend to store the auth tokens when the user is redirected back to the service
  • This token had to be stored in the session data of the user so that it could be used in the rest of the app
  • The final step was to integrate the new initialise/comment/vote/API with the rest of the code.

Thanks

  • to @mkt for creating the app in the first place. He is also a very chill developer to interact with.
  • to @noisy for creating the steemconnect guide



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

1up-logo.png


You've got a 1UP from the @utopian-1up curation trail. 31 Utopians have upvoted your quality contribution to the open source community.

Join 1UP for better posts and high curation rewards.

1UP is neither organized nor endorsed by Utopian.io!

Woohoo, I love this tool. Great that you continue the work @mkt had begun. I will give 1UPs to all contributions for SteemLine. Just drop me a link in discord after publishing

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Thank you so much! Let's make this project great! :D

Hey @hrj I am @utopian-io. I have just upvoted you!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.30
TRX 0.12
JST 0.033
BTC 63155.22
ETH 3108.25
USDT 1.00
SBD 3.85