-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extra parameter needed not in documentation? #21
Comments
auth_token is missing, see
https://github.com/PromyLOPh/pianobar/blob/master/src/libpiano/request.c#L105
|
I'm a bit confused because in this instance, isn't the EDIT: Never mind, I see now why I need EDIT 2: leaving |
As far as I see you’re also missing the syncTime key in your JSON
request.
|
Ok I understand what I'm doing wrong now. Sorry for the confusion! |
I'm sorry to bother you again, but this is just unbelievably frustrating. I keep receiving error code 0 when trying to log in as a user. I am sending this json: |
Hi! |
@thewithz: Alot of implementations are available already, have a look at
https://6xq.net/pandora-apidoc/json/implementations/ Either one of these
already fits your needs or you can look at their requests and figure out
what exactly is different from yours. Error 0 is pretty generic and I
don’t know what is wrong at the moment. Are you encrypting the HTTP POST
body?
@brunoescalona: auth_token is the same as partnerAuthToken *for this
request*. Make sure special chars are urlencoded.
|
@PromyLOPh Thank you for the response. |
@brunoescalona I used something called Blowfish to decrypt the sync time. What language are you using? @PromyLOPh I'm writing an API wrapper in Java, because there is none yet, and I want to interface it with another Java project I am working on. I encrypted the JSON post body with the partner password listed in the API doc. Was there a different encryption I am supposed to be using? |
@thewithz right now I am not using any language. I want to implement it in Node.js but at the moment I am trying to obtain as much info as I can. At the moment I am using POST request by hand with POSTMAN tool, but I am not able to obtain any results. Just the partner authentication. |
encrypted the JSON post body with the partner password listed in the API
doc. Was there a different encryption I am supposed to be using?
Nope, just checking.
|
Just to clarify in case I'm getting this wrong, am I supposed to encrypt the final json or each key value pair individually |
The entire request body:
Unless noted otherwise JSON-encoded requests sent by the client within
the HTTP POST body are encrypted using Blowfish ECB and converted to
hexadecimal notation with lowercase letters.
-- https://6xq.net/pandora-apidoc/json/
|
@brunoescalona at first I got it working, but now two weeks later I am receiving error code 13s on any command i try to run. I think it might have something to do with the fact that Pandora's website got updated... I don't want to show you code that doesn't work. |
@thewithz ok! but I would like just to know how did you do the decoding stuff I was trying to obtain something valid but I just get incoherent data and numbers.... |
@brunoescalona I'm trying to do the same and create a Node.js API. Have you gotten past the Code 0 error? If so, how did you fix it? If you have Discord I'd love to talk to you about it! Add me, |
@FireController1847 sorry for my delay. |
@brunoescalona Aww, alright. |
@FireController1847 here I have all the code I did for the partner authentication but I could not do the login. Just it is usefull for you.... |
@brunoescalona I was able to decode syncTime using the blowfish module you were talking about. Maybe you were having issues for it? Even with syncTime, I couldn't get past the Code 0 error on Postman. |
Looking at request.js, you’re using the wrong password to decrypt the
syncTime. You need the “decrypt password” listed here:
https://6xq.net/pandora-apidoc/json/partners/#partners
|
It's be great if you guys could talk about this on me within Discord. Add me, my name is FireController1847#9085 @PromyLOPh @brunoescalona |
@PromyLOPh Thank you!!!!!! I didn't see the decrypt password and I was using the password itself. https://6xq.net/pandora-apidoc/json/
|
|
@thewithz Are you sending the Body encoded? I think in the user login you should send it encoded.
|
My user brunoescalona#0787 |
@thewithz How did you fix that damn Code 0 error? |
@FireController1847 hi I left the project time ago haha. I could not connect so I just leave it at the end. |
@brunoescalona I keep leaving it but then I keep coming back thinking I'll do it this time.... of course, every time I do it I just receive the same ol' Code 0 error. Until recently, when I figured out something extremely important: We were encrypting incorrectly. |
@FireController1847 why we were encryting incorrectly? |
@brunoescalona When we had the object, we did not need to stringify it and then encrypt it, but instead we needed to encrypt every value within the object. Here's an example below. let userLoginInfo = {
"loginType": "user",
"username": "[email protected]",
"password": "XXXXX",
// "incluePandoraOneInfo": true,
// "includeSubscriptionExpiration": true,
// "returnCapped": true,
// "includeAdAttributes": true,
// "includeAdvertiserAttributes": true,
// "xplatformAdCapable": true,
"partnerAuthToken": res.partnerAuthToken,
"syncTime": calcdSyncTime
} to... Encrypted User Login Info: {
"loginType": "EE1EE3EBFD757FCA",
"username": "XXXX",
"password": "XXXX",
"partnerAuthToken": "F64EAFC5B1FA3A2C7388867A53FA787B7596A4F3E34A403BF6A8A942F41E1DFA1A00444A886473BB",
"syncTime": null
} |
@FireController1847 ok I understand.... so when I have time I will try it again. |
@brunoescalona I'll be on Discord if you want to chat. FireController1847#9085 |
@FireController1847 ok! if I have time I will connect. :) thank you! |
Seeing an error 9 with the following request after a successful partner login: {"loginType":"user","username":"[email protected]","password":"xxxxxxxx","partnerAuthToken":"xxxxxxxxxxxx","syncTime":0} array(3) {
["auth_token"]=>
string(34) "xxxxx"
["partner_id"]=>
string(2) "xx"
["method"]=>
string(14) "auth.userLogin"
} Where Any thoughts? Not sure if 0 is a valid |
@abreksa4 SyncTime cannot be 0, it's a built number using Date.now() and something else (for JS). It's been so long, though, that I can't remember. Sorry :( |
@FireController1847 No problem, thanks for the pointer. Looks like my application (read: environment) was encrypting/decrypting the data incorrectly. Anyone experiencing that? Not really under the scope of this ticket, but figured I'd mention it while I try to work it out. |
Which partner credentials are you using? These work fine for pianobar: https://6xq.net/pandora-apidoc/json/partners/#android
|
@PromyLOPh I'm using the android credentials as well, though I cycled through the rest of the available sets and got the same error, so thinking it's an issue on my end if other projects are using them successfully. |
Alright, figured since I got this resolved I'd post the results here. Turned out to be an issue with PHP 7.2 dropping mcrypt, and the ensuing headaches caused by trying to use openssl instead. Asked the question on freenode in ##php, and was pointed at http://php.net/manual/en/function.openssl-encrypt.php#121545 within 20 minutes, courtesy of Sammitch. Used the magic methods included in that comment and now the api calls are working. Link to the updated php library fork for anyone interested: https://github.com/abreksa4/php-pandora-api |
@abreksa4 You're saying your PHP library is working. Do you mind talking with me on Discord or Email so I can try and get past the userLogin? I'm still getting Code 0. Add me on Discord |
Scratch that on that last comment. I cannot believe it, but I finally got it to work. Thank you everyone who was part of and helped in this thread (even though it's not mine xD)! |
When using method auth.userLogin I am getting an error code 4 URL_PARAM_MISSING_PARTNER_ID. The documentation says that you only need 5 parameters, the method name, the login type, username, password, and partnerAuthToken. But when I send
{ "loginType" : "user", "username" : "uname", "password" : "passwd", "partnerAuthToken" : "token"}
to http://tuner.pandora.com/services/json/?method=auth.userLogin it still says I am missing a parameter.I've tried to send to http://tuner.pandora.com/services/json/?method=auth.userLogin&partnerId=id as well but this also fails.
The text was updated successfully, but these errors were encountered: