Pushbullet Oauth using Bash and curl -
i wrote pushbullet linux command line client in bash. want allow users grant access pushbullet accounts via oauth, i'm having trouble. did oauth google drive api other day. straightforward, requiring few lines of code. honest, oauth section in pushbullet api docs unclear.
let me make sure understand steps required:
- send user pushbullet site url generated in-app
- url should include: client_id , redirect_url (redirect_url specifies url user re-directed after granting access pushbullet, in addition response_type, either token or code)
- user grants or denies access pushbullet account
- if access granted, user sent redirect_url
- client must obtain access_token embedded in redirect_url , append access_token future requests
does sound right?
my script loads authentication url in browser, when click "approve" following error: the param 'redirect_uri' has invalid value
. used redirect_uri listed in "clients" section of pushbullet settings. so, this: https://www.pushbullet.com/login-success/access_token=<access token>&response_type=token&scope=everything
am using correct url? command-line client, , don't have domain it. shouldn't matter, though, right?
does oauth require authentication via browser, or can done via kind of web service call (this how gdrive api seems work)? ideally, have curl handle everything, rather having worry loading web browsers.
hmm, made diagram, guess docs still need work. let me know if have suggestions!
so if want use "client side" flow, should use redirect_uri
of https://www.pushbullet.com/login-success
means authorize_url should https://www.pushbullet.com/authorize?client_id=yw7uitozxpfx8vj4&redirect_uri=https%3a%2f%2fwww.pushbullet.com%2flogin-success&response_type=token
note because http, have urlencode redirect_uri have pasted here. if you're still getting it's invalid redirect_uri, try setting client's redirect_uri https://www.pushbullet.com/login-success
on page: https://www.pushbullet.com/#settings/clients
i'm not sure meant https://www.pushbullet.com/login-success/access_token=<access token>&response_type=token&scope=everything
. maybe meant https://www.pushbullet.com/login-success?access_token=<access token>&response_type=token&scope=everything
, don't think there's need put parameters on redirect_uri
.
one thing can think of here maybe if allow https://www.pushbullet.com/login-success
work clients regardless of redirect_uri
set to, may make easier. let me know wasn't clear can fix it.
i haven't used specific google oauth you're talking about, experience google oauth in general was complicated , hard use oauth implementation have ever used. give me link you're referencing can see how made oauth easier use?
Comments
Post a Comment