S
S
sts2015-09-22 18:39:04
Classmates
sts, 2015-09-22 18:39:04

Why is Bad signature","error":"104 returned when trying to publish media topics?

0. I have app approved
1. there is an authorization link in OK

<a href="https://connect.ok.ru/oauth/authorize?client_id={app_id}&scope=VALUABLE_ACCESS;&response_type=token&redirect_uri=http://site.ru/&layout=m"><img src="/ok/logo_default.png" style="background:#cf6700"></a>

After which I get access_token and session_secret_key.
Next, I tried to make a digital signature in two different ways
2.1 As in the calculator
2.2 So according to this guide
3. Then, I form a URL of the following form (I tried both encoded and non-encoded options):
http://connect.ok.ru/dk?st.cmd=WidgetMediatopicPost&st.app=app_id&st.attachment={%22media%22:[{%22type%22:%22text%22,%22text%22:%22shit%22}]}&st.signature=signature&st.return=http://site.ru

And always in response I get Bad signature","error":"104
Can anyone suggest something about this?
Ideally, I need authorization with sending a message and a response about the user's action

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vjacheslav Kanivetc, 2015-09-23
@stunoff

Because the request lacks an access_token field to indicate that this is a specific OAUTH session. Without it, the session is taken from the cookie, where it either does not exist or does not match the signature.
Widget example on github https://github.com/apiok/js_sample_widgets/blob/gh...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question