ledgerconnect/steemconnect

401 error on broadcast(operations)

Closed this issue · 4 comments

KrNel commented

Expected behavior

The broadcasting of a post to work.

Actual behavior

Broadcasting a postdoesn't work.

When I try to do a SteemConnect.broadcast(operations), I get a 401 error:

error 401

This is the valid content of operations (as far as I can tell). The image has the second account (kure), and the text below has the first account (testify).

image

operations 
(2) [Array(2), Array(2)]
0: Array(2)
0: "comment"
1:
author: "testify"
body: "test"
json_metadata: "{"community":"kure","app":"kure/0.1.0","format":"markdown","tags":["test"],"users":[],"links":[],"image":[]}"
parent_author: ""
parent_permlink: "test"
permlink: "testt"
title: "Testt"
__proto__: Object
length: 2
__proto__: Array(0)
1: Array(2)
0: "comment_options"
1:
allow_curation_rewards: true
allow_votes: true
author: "testify"
extensions: []
max_accepted_payout: "1000000.000 SBD"
percent_steem_dollars: 10000
permlink: "testt"
__proto__: Object
length: 2
__proto__: Array(0)
length: 2
__proto__: Array(0)

Steps to reproduce the behavior

SteemConnect.broadcast(operations)

I managed to get a post sent once, but now I can't get any more. I thought of RC being low on a test account, and switched to another, but it still gives a 401 error. Any idea what's going on?

Thank you!

I can SteemConnect.comment() and vote(), but not the broadcast.

@KrNel you can get the complete error on your browser by going to the console > Network > select the request and > Preview.

KrNel commented

Thanks for the reply.

{error: "invalid_grant", error_description: "The token has invalid role"}
error: "invalid_grant"
error_description: "The token has invalid role"

The accesses given to kure.app on SteemConnect are:

image

scope: ['login', 'offline', 'vote', 'comment', 'delete_comment', 'comment_options', 'custom_json']

I thought this was all that was needed. It worked once only, but on the account with 0 sp... and kure now has 500 SP delegated to it... yet it won't...

Thanks for the help!

@KrNel you will get The token has invalid role error also if the token has already expired. Maybe that's the case?

KrNel commented

This is resoled thanks to fabien for helping me out. The login role was the issue. Closing.