Skip to content
Snippets Groups Projects
Commit e794a42f authored by inertia's avatar inertia
Browse files

deploying hivesigner updates to master

parent 8b134b91
No related branches found
No related tags found
6 merge requests!69Tutorials audit (RB),!66Tutorials audit (PY),!54Tutorials audit (JS),!41Tutorials audit,!26Refactoring misc steem 2,!25Refactoring misc steem 2
Showing
with 461 additions and 349 deletions
---
title: Hivesigner Libs
position: 4
---
Most people who will be implementing OAuth2 will want to find and utilize a library in the language of their choice. These libraries, while not necessarily built by Steemit, should support the Hivesigner API.
If you're wondering what Hivesigner is, go [here]({{ '/services/#services-hivesigner' | relative_url }}).
---
**Hivesigner SDK** - [https://github.com/ledgerconnect/hivesigner.js](https://github.com/ledgerconnect/hivesigner.js)
An official javascript library for utilizing Hivesigner.
---
---
title: SteemConnect Libs
position: 4
---
Most people who will be implementing OAuth2 will want to find and utilize a library in the language of their choice. These libraries, while not necessarily built by Steemit, should support the SteemConnect API.
If you're wondering what SteemConnect is, go [here]({{ '/services/#services-steemconnect' | relative_url }}).
---
**SteemConnect SDK** - [https://github.com/steemit/steemconnect-sdk](https://github.com/steemit/steemconnect-sdk)
An official javascript library for utilizing SteemConnect.
---
**steem-connect-firebase-function** - [https://jakipatryk.github.io/steemconnect-firebase-functions/](https://jakipatryk.github.io/steemconnect-firebase-functions/)
A TypeScript library that can help you build applications with SteemConnect and Firebase.
---
**Sc2 SDK PHP** - [https://github.com/hernandev/sc2-sdk-php](https://github.com/hernandev/sc2-sdk-php)
Easily integrate STEEM blockchain into your PHP applications, though SteemConnect.
---
**Social Auth SteemConnect** - [https://pypi.python.org/pypi/social-auth-steemconnect/0.0.2](https://pypi.python.org/pypi/social-auth-steemconnect/0.0.2)
Pluggable authentication backend for python-social-auth, that allows authentication via SteemConnect (v2).
---
**steemconnect-python-client** - [https://github.com/emre/steemconnect-python-client](https://github.com/emre/steemconnect-python-client)
steemconnect-python-client is a simple yet powerful library to interact with the Steemconnect.
---
**omniauth-steemconnect** - [https://rubygems.org/gems/omniauth-steemconnect/versions/0.1.0](https://rubygems.org/gems/omniauth-steemconnect/versions/0.1.0)
Ruby Omniauth2 Strategy for SteemConnect.
---
**SwiftyConnect** - [https://github.com/caspernikus/SwiftyConnect](https://github.com/caspernikus/SwiftyConnect)
SteemConnect Library for iOS / Swift.
---
**SteemConnect4j** - [https://github.com/hapramp/steemconnect4j](https://github.com/hapramp/steemconnect4j)
Steemconnect SDK for Java.
--- ---
title: SteemConnect title: HiveSigner
position: 2 position: 2
--- ---
**What is SteemConnect?** **What is HiveSigner?**
The goal of SteemConnect is to provide a safe way of connecting to the blockchain via 3rd party apps without compromising the security of your private keys and passwords. It's a simple identity layer built on top of the blockchain allowing users safe access and developers the freedom of not having to handle the authentication system, i.e. managing users' private keys and encryption. This means that devs won't have to opensource their projects in order to gain user trust. When connecting to apps in this manner, neither SteemConnect nor the authorised app store the private keys as the posting key is incrypted on your cookie. The goal of HiveSigner is to provide a safe way of connecting to the blockchain via 3rd party apps without compromising the security of your private keys and passwords. It's a simple identity layer built on top of the blockchain allowing users safe access and developers the freedom of not having to handle the authentication system, i.e. managing users' private keys and encryption. This means that devs won't have to opensource their projects in order to gain user trust. When connecting to apps in this manner, neither Hivesigner nor the authorised app store the private keys as the posting key is incrypted on your cookie.
**How SteemConnect is implemented** **How HiveSigner is implemented**
SteemConnect works by granting an access token to the requesting app once the application has been approved. HiveSigner works by granting an access token to the requesting app once the application has been approved.
A full tutorial on how to set up an application, request authorisation and grant access can be found [here]({{ '/tutorials-javascript/steemconnect' | relative_url }}). A full tutorial on how to set up an application, request authorisation and grant access can be found [here]({{ '/tutorials-javascript/hivesigner' | relative_url }}).
**Steem Authorisation and OAuth 2** **Hive Authorisation and OAuth 2**
The OAuth protocol allows third party apps to grant limited access to an HTTP service, either on behalf of a resource owner or by allowing the app to obtain access on its own behalf. The authorisation is provided without the private key or password of the user being shared with the third party. The OAuth protocol allows third party apps to grant limited access to an HTTP service, either on behalf of a resource owner or by allowing the app to obtain access on its own behalf. The authorisation is provided without the private key or password of the user being shared with the third party.
Simplified, the process includes the following steps: Simplified, the process includes the following steps:
...@@ -23,12 +23,12 @@ Simplified, the process includes the following steps: ...@@ -23,12 +23,12 @@ Simplified, the process includes the following steps:
3. The user is redirected to the application redirect URI along with the access token 3. The user is redirected to the application redirect URI along with the access token
Once the application has an access token, it may use the token to access the user's account via the API, limited to the scope of access, until the token expires or is revoked. Once the application has an access token, it may use the token to access the user's account via the API, limited to the scope of access, until the token expires or is revoked.
A full breakdown of OAuth2 and how it applies to SteemIt and SteemConnect can be found [here](https://github.com/steemit/steemconnect/wiki/OAuth-2#code-authorization-flow). A full breakdown of OAuth2 and how it applies to Hive and HiveSigner can be found [here](https://github.com/ledgerconnect/hivesigner/wiki/OAuth-2#code-authorization-flow).
**Useful Links** **Useful Links**
* [SteemConnect Repo](https://github.com/steemit/steemconnect) * [HiveSigner Repo](https://github.com/ledgerconnect/hivesigner)
* [Community Resources]({{ '/resources/#community-steem-connect-libs' | relative_url }}) * [Community Resources]({{ '/resources/#community-hivesigner-libs' | relative_url }})
For additional material you can refer to the original steemit [blog](https://steemit.com/steemconnect/@busy.org/introducing-steemconnect-by-busy-identity-authentication-authorization-for-steem-blockchain-s-apps) post by [busy.org](https://busy.org/) For additional material you can refer to the original Hive [blog](https://hive.blog/hive/@good-karma/hivesigner-released-and-ready) post by [@good-karma](https://hive.blog/)
--- ---
title: 'JS: Steemconnect' title: 'JS: Hivesigner'
position: 2 position: 2
description: "_Understand the basics of using Steemconnect with your Steem application._" description: "_Understand the basics of using Hivesigner with your Hive application._"
layout: full layout: full
--- ---
<span class="fa-pull-left top-of-tutorial-repo-link"><span class="first-word">Full</span>, runnable src of [Steemconnect](https://gitlab.syncad.com/hive/devportal/-/tree/develop/tutorials/devportal-tutorials-js/tutorials/02_steemconnect) can be downloaded as part of: [tutorials/devportal-tutorials-js](https://gitlab.syncad.com/hive/devportal/-/tree/develop/tutorials/devportal-tutorials-js).</span> <span class="fa-pull-left top-of-tutorial-repo-link"><span class="first-word">Full</span>, runnable src of [Hivesigner](https://gitlab.syncad.com/hive/devportal/-/tree/develop/tutorials/devportal-tutorials-js/tutorials/02_hivesigner) can be downloaded as part of: [tutorials/devportal-tutorials-js](https://gitlab.syncad.com/hive/devportal/-/tree/develop/tutorials/devportal-tutorials-js).</span>
<br> <br>
In this tutorial we will setup Steemconnect for demo application and step by step show the process of setting up dedicated account for your app to use Steemconnect Dashboard and setup backend of your application to use Steemconnect authorization properly. In this tutorial we will setup Hivesigner for demo application and step by step show the process of setting up dedicated account for your app to use Hivesigner Dashboard and setup backend of your application to use Hivesigner authorization properly.
## Intro ## Intro
The application in this tutorial asks the user to grant an access to `demo-app` and get token from Steemconnect. Once permission is granted, `demo-app` can get details of user via an api call that requires access token. The application in this tutorial asks the user to grant an access to `demo-app` and get token from Hivesigner. Once permission is granted, `demo-app` can get details of user via an api call that requires access token.
Purpose is to allow any application request permission from user and perform action via access token. Purpose is to allow any application request permission from user and perform action via access token.
Some other calls that require an access token (or login) are: Some other calls that require an access token (or login) are:
...@@ -24,50 +24,40 @@ Some other calls that require an access token (or login) are: ...@@ -24,50 +24,40 @@ Some other calls that require an access token (or login) are:
* Follow * Follow
* Reblog * Reblog
Learn more about [Steemconnect operations here](https://github.com/steemit/steemconnect-sdk) Learn more about [Hivesigner operations here](https://github.com/ledgerconnect/hivesigner.js)
## Steps ## Steps
1. [**Steemconnect Dashboard**](#sc-dashboard) Create account for application and set up dashboard 1. [**Hivesigner Dashboard**](#dashboard) Create account for application and set up dashboard
1. [**Initialize Steemconnect**](#init-sc) Initialize SDK in your application code 1. [**Initialize Hivesigner**](#init) Initialize SDK in your application code
1. [**Login URL**](#login-url) Form login url for user 1. [**Login URL**](#login-url) Form login url for user
1. [**Request token**](#request-token) Request token with login url 1. [**Request token**](#request-token) Request token with login url
1. [**Set token**](#set-token) Set or save token for future requests 1. [**Set token**](#set-token) Set or save token for future requests
1. [**Get user data**](#get-user) Get user details with token 1. [**Get user data**](#get-user) Get user details with token
1. [**Logout**](#logout) Logout user and clear token 1. [**Logout**](#logout) Logout user and clear token
#### 1. Steemconnect Dashboard<a name="sc-dashboard"></a> #### 1. Hivesigner Dashboard<a name="dashboard"></a>
Steemconnect is unified authentification system built on top of Steem built in collaboration of Busy.org and Steemit Inc. Hivesigner is unified authentification system built on top of Hive.
Layer to ensure easy access and setup for all application developers as well as secure way for users to interact with Steem apps. Layer to ensure easy access and setup for all application developers as well as secure way for users to interact with Hive apps.
Setting up Steemconnect in your app is straight-forward process and never been this easy. Setting up Hivesigner in your app is straight-forward process and never been this easy.
Here are the steps that helps you to setup new app: Here are the steps that helps you to setup new app:
1a. Visit [Steemconnect Dashboard](https://steemconnect.com/dashboard) and login with your Steem credentials 1a. Visit [Hivesigner Dashboard](https://hivesigner.com/profile) and login with your Hive credentials for your app
![steemconnect_login](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/devportal-tutorials-js/tutorials/02_steemconnect/images/steemconnect_login.png) ![hivesigner_login](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/devportal-tutorials-js/tutorials/02_hivesigner/images/hivesigner_login.png)
1b. You will see Applications and Developers section, in Developers section click on `My Apps` 1b. You will see Account type, User and Application section, in Application section fill out details of App
![steemconnect_dashboard](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/devportal-tutorials-js/tutorials/02_steemconnect/images/steemconnect_dashboard.png) ![hivesigner_dashboard](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/devportal-tutorials-js/tutorials/02_hivesigner/images/account_type_application.png)
![steemconnect_new_app](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/devportal-tutorials-js/tutorials/02_steemconnect/images/steemconnect_new_app.png) 1c. Give your app name, description, icon image link, website (if available) and Redirect URI(s)
1c. Create New App using Steemconnect, which will help you create new Steem account for your application. Let's call it `demo-app` for this tutorial purpose. Here is an example of [Esteem](https://esteem.app) form to give you idea how to fill form correctly.
![steemconnect_account_create](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/devportal-tutorials-js/tutorials/02_steemconnect/images/steemconnect_account_create.png) ![hivesigner_myapps](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/devportal-tutorials-js/tutorials/02_hivesigner/images/hivesigner_myapp.png)
Account creation fee will be deducted from your balance, make sure you have enough funds to complete account creation.
Next step is to login with account which has enough balance to pay for account creation fee.
![steemconnect_signin](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/devportal-tutorials-js/tutorials/02_steemconnect/images/steemconnect_signin.png)
1d. Give your app name, description, icon image link, website (if available) and Redirect URI(s)
![steemconnect_myapps](https://gitlab.syncad.com/hive/devportal/-/raw/master/tutorials/devportal-tutorials-js/tutorials/02_steemconnect/images/steemconnect_myapps.png)
Application name and description should give users clear understanding what permissions it requires and what is the purpose of the app. Application name and description should give users clear understanding what permissions it requires and what is the purpose of the app.
...@@ -75,24 +65,24 @@ App Icon field should be publicly accessible and available link to your logo or ...@@ -75,24 +65,24 @@ App Icon field should be publicly accessible and available link to your logo or
Website field is homepage for the application if exist. Website field is homepage for the application if exist.
Redirect URI(s) will be used within your application to forward user after authentification is successful. You can specify multiple callback URLs with each new line. Callback in Steemconnect SDK should match exactly one of URI(s) specified on this page. Due to security reasons if redirect URI(s) used in SDK is other than you specified, it will not work. Redirect URI(s) will be used within your application to forward user after authentification is successful. You can specify multiple callback URLs with each new line. Callback in Hivesigner SDK should match exactly one of URI(s) specified on this page. Due to security reasons if redirect URI(s) used in SDK is other than you specified, it will not work.
This is typical backend web development, we hope you know how to set up your backend/app to handle callback URLs. This is typical backend web development, we hope you know how to set up your backend/app to handle callback URLs.
* Disclaimer: All images/screenshots of user interface may change as Steemconnect evolves * Disclaimer: All images/screenshots of user interface may change as Hivesigner evolves
#### 2. Initialize Steemconnect<a name="init-sc"></a> #### 2. Initialize Hivesigner<a name="init"></a>
Once you have setup account for new application, you can setup application with Steemconnect authentification and API processes. Once you have setup account for new application, you can setup application with Hivesigner authentification and API processes.
To do that, you will need to install `sc2-sdk` nodejs package with `npm i sc2-sdk`. To do that, you will need to install `hivesigner` nodejs package with `npm i hivesigner`.
Within application you can initialize Steemconnect Within application you can initialize Hivesigner
> `app` - is account name for application that we have created in Step I.3, `callbackURL` - is Redirect URI that we have defined in Step I.4, `scope` - permissions application is requiring/asking from users > `app` - is account name for application that we have created in Step I.3, `callbackURL` - is Redirect URI that we have defined in Step I.4, `scope` - permissions application is requiring/asking from users
Now that `sc2-sdk` is initialized we can start authentication and perform simple operations with Steemconnect. Now that `hivesigner` is initialized we can start authentication and perform simple operations with Hivesigner.
#### 3. Login URL<a name="login-url"></a> #### 3. Login URL<a name="login-url"></a>
> `getLoginURL` function you see on the right side, returns login URL which will redirect user to sign in with Steem connect screen. Successfull login will redirect user to Redirect URI or `callbackURL`. Result of successful login will return `access_token`, `expires_in` and `username` information, which application will start utilizing. > `getLoginURL` function you see on the right side, returns login URL which will redirect user to sign in with Hivesigner screen. Successfull login will redirect user to Redirect URI or `callbackURL`. Result of successful login will return `access_token`, `expires_in` and `username` information, which application will start utilizing.
#### 4. Request token<a name="request-token"></a> #### 4. Request token<a name="request-token"></a>
...@@ -102,23 +92,23 @@ Now that `sc2-sdk` is initialized we can start authentication and perform simple ...@@ -102,23 +92,23 @@ Now that `sc2-sdk` is initialized we can start authentication and perform simple
> Returned data has `access_token` - which will be used in future api calls, `expires_in` - how long access token is valid in seconds and `username` of logged in user. > Returned data has `access_token` - which will be used in future api calls, `expires_in` - how long access token is valid in seconds and `username` of logged in user.
> After getting `access_token`, we can set token for future Steemconnect API requests. > After getting `access_token`, we can set token for future Hivesigner API requests.
#### 6. Get user data<a name="get-user"></a> #### 6. Get user data<a name="get-user"></a>
> Users info can be checked with `me` which will return object > Users info can be checked with `me` which will return object
> `account` - current state of account and its details on Steem blockchain, `name` - username, `scope` - permissions allowed with current login, `user` - username, `user_metadata` - additional information user has setup. > `account` - current state of account and its details on Hive blockchain, `name` - username, `scope` - permissions allowed with current login, `user` - username, `user_metadata` - additional information user has setup.
#### 7. Logout<a name="logout"></a> #### 7. Logout<a name="logout"></a>
> In order to logout, you can use `revokeToken` function from sc2-sdk. > In order to logout, you can use `revokeToken` function from hivesigner.
**That's all there is to it.** **That's all there is to it.**
### To Run the tutorial ### To Run the tutorial
1. `git clone https://gitlab.syncad.com/hive/devportal.git` 1. `git clone https://gitlab.syncad.com/hive/devportal.git`
1. `cd devportal/tutorials/devportal-tutorials-js/tutorials/02_steemconnect` 1. `cd devportal/tutorials/devportal-tutorials-js/tutorials/02_hivesigner`
1. `npm i` 1. `npm i`
1. `npm run dev-server` or `npm run start` 1. `npm run dev-server` or `npm run start`
1. After a few moments, the server should be running at [http://localhost:3000/](http://localhost:3000/) 1. After a few moments, the server should be running at [http://localhost:3000/](http://localhost:3000/)
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<li><a href="/services/#services-steemconnect">SteemConnect</a></li> <li><a href="/services/#services-hivesigner">Hivesigner</a></li>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
<li><a href="/resources/#resources-steem-connect-libs">SteemConnect Libs</a></li> <li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<li><a href="/services/#services-steemconnect">HiveSigner</a></li> <li><a href="/services/#services-hivesigner">HiveSigner</a></li>
......
File moved
This diff is collapsed.
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
<li><a href="/services/#services-steemconnect">SteemConnect</a></li> <li><a href="/services/#services-hivesigner">Hivesigner</a></li>
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
<li><a href="/resources/#resources-steem-connect-libs">SteemConnect Libs</a></li> <li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<li><a href="/services/#services-steemconnect">SteemConnect</a></li> <li><a href="/services/#services-hivesigner">Hivesigner</a></li>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
<li><a href="/resources/#resources-steem-connect-libs">SteemConnect Libs</a></li> <li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<li><a href="/services/#services-steemconnect">SteemConnect</a></li> <li><a href="/services/#services-hivesigner">Hivesigner</a></li>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
<li><a href="/resources/#resources-steem-connect-libs">SteemConnect Libs</a></li> <li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<li><a href="/services/#services-steemconnect">SteemConnect</a></li> <li><a href="/services/#services-hivesigner">Hivesigner</a></li>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
<li><a href="/resources/#resources-steem-connect-libs">SteemConnect Libs</a></li> <li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<li><a href="/services/#services-steemconnect">SteemConnect</a></li> <li><a href="/services/#services-hivesigner">Hivesigner</a></li>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
<li><a href="/resources/#resources-steem-connect-libs">SteemConnect Libs</a></li> <li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<li><a href="/services/#services-steemconnect">SteemConnect</a></li> <li><a href="/services/#services-hivesigner">Hivesigner</a></li>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
<li><a href="/resources/#resources-steem-connect-libs">SteemConnect Libs</a></li> <li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
......
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
<li><a href="/services/#services-steemconnect">SteemConnect</a></li> <li><a href="/services/#services-hivesigner">Hivesigner</a></li>
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
<li><a href="/resources/#resources-steem-connect-libs">SteemConnect Libs</a></li> <li><a href="/resources/#resources-hivesigner-libs">Hivesigner Libs</a></li>
......
tutorials/devportal-tutorials-js/tutorials/02_hivesigner/images/hivesigner_login.png

36.2 KiB

tutorials/devportal-tutorials-js/tutorials/02_hivesigner/images/hivesigner_myapp.png

123 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment