How to add posting auth to utopian.app without using steemconnect. Tutorial for those who does not like to share their private keys

in #utopian-io7 years ago (edited)

For very long time i wanted to check how does utopian works, Unfortunately, even browsing requires to login and this requires you to set up an account and give your wif to 3rd party which is steemconnect.

I know we can trust steemconnect and it wont do anything bad with our account but still some of us dont like to share their passwords or private key with anyone it is smart to keep private keys only for yourself.

We will use great javascript library to communicate with steemd - steemjs https://github.com/adcpm/steem and we will use to set posting auth to utopian.app account. Our first step will be creating steemconnect v2 account
I. Go to the https://v2.steemconnect.com/dashboard and creat new account using one of required wifs
II. Open your favourite text editor and past there following code. It simply get your account data from the blockchain, then it updates it with new posting authority and then it broadcast account update back to the steem blockchain.


steem.api.getAccounts(['yourAccountName'], function(err, response){
    if(response) {
                document.getElementById("json").innerHTML = JSON.stringify(response, undefined, 2);
        var account = response[0];
        var postingAuth = account.posting;
        postingAuth.account_auths.push('accountToWhomYouGivePermission', postingAuth.weight_threshold]);
        steem.broadcast.accountUpdate('wif', 'yourAccountName', undefined, undefined, 
       postingAuth, account.memo_key, account.json_metadata, function(err, result) {
                console.log(result);
                console.log(err);
   });
    }
}); </script></body> 

III. Change the following parts
-put your account name in ['yourAccountName'] in my case it would be ['whd']
-put account name with who you want share posting Auth in 'accountToWhomYouGivePermission' if you want it to be utopian put 'utopian.app'
-put your private active key in 'wif'
-again put your account name in 'yourAccountName'
IIII. Save the file with whatever_name_you_want.html
IIIII. Open file with your favourite web browser, after few seconds utopian.app account should share posting auth with your account, what you can check on steemd.com webpage - Authorities section

And on stemdb.com or steemd.com you will see Account Update event.
So now you shoul be able to login in utopian.io without revealing your active password to anyone.
Of course you can set posting auth to any account using this script. If you would like to know what else you can do with steemjs check out their documentation on the github.
It is my first contribution and post from utopian.io. Hope you will find that tutorial usefull.
Ps. Editor needs some enhancements regarding markdown stylization handling like add code button.

BR
@whd



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thanks, that might be useful!

Thank you for the contribution. It has been approved.

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

Hey @whd I am @utopian-io. I have just upvoted you at 7% Power!

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • This is your first accepted contribution here in Utopian. Welcome!

Suggestions

  • Work on your followers to increase the votes/rewards. I follow what humans do and my vote is mainly based on that. Good luck!
  • Contribute more often to get higher and higher rewards. I wish to see you often!
  • I introduced a competition factor. My vote is based also on how competitive the category used is.

Human Curation

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

geek post!

@whd it actually doesn't work even after I added the missing html tags < body >
< script > ..pls advise

Coin Marketplace

STEEM 0.19
TRX 0.12
JST 0.027
BTC 61110.82
ETH 3368.39
USDT 1.00
SBD 2.48