EionRobb / pidgin-pushbullet

A Pushbullet plugin for Pidgin
GNU General Public License v3.0
42 stars 12 forks source link

Insufficient Authorization #13

Open Daxiongmao87 opened 8 years ago

Daxiongmao87 commented 8 years ago

Perhaps there isnt enough info, but after putting my email in the Username section and the Access Token in the password, it will not connect. It gives me the error stated in the title. What am I missing?

EionRobb commented 8 years ago

Just to check, you're using the access token generated by the button on the https://www.pushbullet.com/#settings/account page, and not the automatic one that pops up and asks if Pidgin wants to connect to Pushbullet?

Daxiongmao87 commented 8 years ago

Thanks for the quick reply! the one at the bottom of the settings page in the account section yes, pidgin never asks anything, just goes straight to insufficient authorization

EionRobb commented 8 years ago

Hmm... and the email address used is the same google account that you use to sign into Pushbullet with?

Daxiongmao87 commented 8 years ago

that's correct. I've tried with @gmail.com and without. Just to be sure, the token is in that black text field with white letters? Rather long string? If so, that's what i use for the password. Could it be that I've built from source incorrectly?

EionRobb commented 8 years ago

Yeah, that's the right access token to be using. Should be a longish string starting with o.

Hmm.. that's worrying that it's not working. Are you able to email me a debug log of it happening, it might shed some extra light on the situation

Daxiongmao87 commented 8 years ago

if you can instruct me how i can do that immediately!

EionRobb commented 8 years ago

If you open up the Help->Debug Window and then try to connect to the account, then copy-paste that in an email to me eion@robbmob.com

lylebrown commented 8 years ago

What appears to be the relevant portion of the log (after the cert successfully validates):

(21:55:18) util: Response headers: 'HTTP/1.0 403 Forbidden
X-Ratelimit-Limit: 16384
X-Ratelimit-Remaining: 16379
X-Ratelimit-Reset: 1453528985
Content-Type: application/json; charset=utf-8
Vary: Accept-Encoding
Date: Sat, 23 Jan 2016 05:55:18 GMT
Server: Google Frontend
Cache-Control: private
Alt-Svc: quic=":443"; ma=604800; v="30,29,28,27,26,25"
Accept-Ranges: none

'
(21:55:18) pushbullet: Got response: {"error":{"code":"","type":"invalid_request","message":"Insufficient authorization.","cat":"(=^‥^=)"}}
(21:55:18) connection: Connection error on 054788A8 (reason: 2 description: Insufficient authorization.)
EionRobb commented 8 years ago

I believe I've updated the plugin to work without using undocumented API such as the /everything api which was failing, due to the way Pushbullet changed the "access token" that you could pick out from your Settings page to not be a 'super' token that could access everything

If you're able to compile it (on Linux) or try libpushbullet-debug.zip (on Windows) and see if it works for you?

I believe this change should also have the beneficial side effect of being able to use regular OAuth from Pushbullet instead of having to get users to get their access token manually from the Settings page :)

lylebrown commented 8 years ago

@EionRobb On Windows, it's crashing for me using my access token. The only error in the debug log is "nss: partial certificate chain". I tried deleting the cached cert as well, and still had this issue.

How would I use OAuth instead?

Daxiongmao87 commented 8 years ago

@EionRobb seems to cause pidginto freeze on linux. I know we discussed it, but I thought I'd post on here for awareness.

lylebrown commented 8 years ago

@Daxiongmao87 It seems like @EionRobb prefers to discuss issues through IM via Pidgin, eh? :) I'll add that Eion mentioned it's a problem with the Text message portion of the request, seemingly on Pushbullet (API)'s end.

EionRobb commented 8 years ago

Yeah, just to clarify everything: The settings page on the Pushbullet site used to provide an access token that would allow access to everything, but now they output access tokens starting with o. that only has partial access, so it doesn't give a way to do important things like asking for the phone address book. I've tried coding around it but it breaks, so I'm now looking at ways of accessing the "super" access token that has the access we need.

Mattie432 commented 8 years ago

Any update on this? Currently running into this error.

ColtonBeery commented 8 years ago

Just wanted to say that I was getting the exact same error when I tried to use this an hour ago.

synthead commented 8 years ago

I am also seeing this error.

ofus commented 7 years ago

Is there any workaround?

EionRobb commented 7 years ago

@ofus the workaround is to use the Web Inspector in your browser to try to find the refresh token that the pushbullet page is using - which is different to the one that they offer through the pushbullet settings page, annoyingly

CAaronL commented 7 years ago

I'm getting this "insufficient authorization" error as well... Could someone walk me through the workaround? Where can I find that refresh token you are referring to? Looking at page source but not having luck finding it.

nelmsee commented 7 years ago

@CAaronL @ofus here are the steps I took to find the "refresh token"

First make sure you have done a few precautionary steps:

-Enable sms on pushbullet on your mobile applicaton -login to pushbullet on your desktop and ensure the desktop app and phone are syncing -if using a gmail account, ensure your gmail account allows for "less secure" apps to access your account

Then follow the steps I took:

  1. Added pushbullet account in pidgin with my email address (left the password option blank)
  2. Prompt window popped up with "approve or deny" access in pushbullet
  3. After clicking "Approve", a new page opened up with the "success token"
  4. (In Google Chrome) While on the "success token" page. Open the Settings (three buttons to top right) > more tools > developer tools.
  5. In the top columns, select "Application"
  6. On the left hand side, select "Local Storage" > "https:/www.pushbullet.com/"
  7. In the "Key" column select "Dekstop", to the right in the "Value" pushbullet access token is " "
  8. Copy this code without the ' ' marks
  9. In Pidgin, Accounts > manage accounts > modify the pushbullet account
  10. Paste the correct access code into the password section.

From here it should work, It immediately imported all of my contacts. It's been working great and syncing well. The only issue I have to report is the way pidgin handles group texts. It seems all group replies APPEAR to come from the same person, but in actuality, multiple people are replying.

Hope this helps.

robross0606 commented 7 years ago

@nelmsee your instructions should be listed on the friggin' readme. Thank you!

jet-lagger commented 7 years ago

Thank you @EionRobb, @nelmsee and all others for the help !

Thanks to your instructions I got Pidgin to connect to my Pushbullet account using FF page inspector.

Now i trouble seeing my contacts and sending SMS but that's the next step i guess.

Thank you !

apippin commented 7 years ago

nelmsee comments on Dec 12, 2016 saved the day for me to. I highly recommend you add those steps in that post to your README. I know it isn't the long term/permanent solution you are looking for, but it is what works right now, and it would have saved some time to have that up front in your README, esp because it works!