Log In Using Steem Connect Connected via Steem Connect as @{{username}} Log Out

The purpose of this post is to help developers including myself to integrate Steem Connect. It would have helped me if it had existed before.

You can find this content at http://www.steemfiles.com/steemconnect_notes.html.

documentaiton of the function signatures only at:

  • github by the developers of Steem Connect.

    In order to use the steemconnect API, you must first register your app over at their site.

    I will not go through all of the time to put this as a github pull request. I am not going to beg for people to include this in the steemconnect github page. If they want it, let them beg me.

    Working Examples

    By taking the example, at https://github.com/bonustrack/bonustrack.github.io/tree/master/tutorials comments, and substituting your own parameters for steemconnect.init(), you can check whether steemconnect has the necessary configurations from you in order to use it. You will need to go to http://v1.steemconnect.com (no www) to seutp up your app.

    Setting up your App for Steem Connect:

    A word on dev.steemconnect.com

    Also please setup your app on v1.steemconnect.com not dev.steemconnect.com. [The] Dev branch is only used for the development of SteemConnect [itself].
    -- @fabien

    Once you login to Steem Connect you will find a button for 'Developers <>.' Click on that, and choose 'setup your app'.

    Author

    This value has no effect what-so-ever on how your programs interact with steemconnect. It is the author of the app. So, if the developer who wrote the app for you was xeroc, put xeroc.

    Requested permissions

    The app must demand something in order for this to work at all. The permissions are Vote, Follow, Reblog, Comment and Post. There is no 'log in' permission. Leaving them all unchecked means you will not be able to accept logins. I suspect it is enough to check one box and you will be able to accept logins.

    Allowed Origins

    These are the URLs where the user will open the Steem Connect login page from. You will need to put in the URL for all pages that could open a login. These must include the scheme part and the host part but not the path part. As in "https://www.steemfiles.com".

    Allowed redirect URLs

    These are the URLs that Steem Connect should redirect your post to after the user logs in successfully. As with allowed origins, these must contain a scheme part, host part but no path part. But you also should include full URLs with the path part as in "https://www.steemfiles.com/cgi-bin/login.cgi"..

    Development vs. Production

    This signals whether your App is in development mode or production mode. There is no functional difference.

    Writing the Code

    All Steemconnect calls do not return anything but take callbacks. These callbacks each take two arguments in the following order: error, result. If there is an error in the call, the callback is called with error set to a message and the result is set to null. If the call succeeds, the error is set to null and the result is where the useful information is.

    steemconnect.init({
    baseURL: 'https://v1.steemconnect.com',
    app:
    The steemit.com username you logged in as in order to setup your app,
    callbackURL:
    The URL on your site, Steem Connect should redirect the user to after login
    });
    Initializes the steemconnect object. It should be the first call made among other steemconnect routines.

    steemconnect.getLoginURL(); Returns the URL the user must browse to in order to log in. The Log out URL is always: https://v1.steemconnect.com/logout

    steemconnect.isAuthenticated(callback); Makes a request and calls callback with parameters (err, null) on failure to get information or (null, result) on successful communication with the Steem Connect server. When logging in, after entering the WIF or password you will get an RedirectUrl Mismatch error if the call back URL (with the path) is not listed in the Allowed redirect URLs

    The Steem Connect server may deny your request with a 400 error if

    On success, the result hash contains the following members:

    steemconnect.vote(voter, author, permlink, weight, callback); Sets the vote weight for an author permlink combination. A complete vote has a weight of 10,000. A vote with weight 0 is considered the same as no vote at all.

    The callback expects two parameters, err and result. On success, the call back is called with err set to null and result set to an object with a single member: result. Now this member result.result has the following members:

    Related articles:


    Documentation Author: @leprechaun

    {{vote_count}} votes

    Comment the post @{{parentAuthor}}/{{parentPermlink}} @{{username}} Log Out Log In