Samik081 / beets-beatport4

Beatport API v4 compatible beets plugin
MIT License
26 stars 2 forks source link

Not an issue: Help getting access token on webapp? #14

Closed ezescigo closed 7 months ago

ezescigo commented 9 months ago

Hi Samik!

This is not an issue, more a help-wise discussion :)

As you know Beatport team is not granting access to their APIs... is there a way to reproduce your workflow using the public client_id that their frontend uses to get an access token on a serverless app or through postman?

I tried but cannot get the "Location" header with the code that I'm supposed to get on the response. Would you help me with the https://api.beatport.com/v4/auth/o/authorize/ and the https://api.beatport.com/v4/auth/o/token/ requests please?

Samik081 commented 9 months ago

Hey @ezescigo, my guess is that you have "Automatically follow redirects" option ticked in Postman (this is default setting afair) :).

My tip: you have the login form working on their docs site, so you can always try peeking into the requests in the "Network" tab of your browser tools to see what's exactly happening there. You could also further copy the requests "as curl" to manually reproduce the flow.

Samik081 commented 9 months ago

Also, very important: NEVER post your session cookies publicly, as anyone could impersonate you (steal your session) in the given service by just copying them.

FYI I have removed the screenshot you attached as it contained the session cookie valid until 23.02

ezescigo commented 9 months ago

Hi @Samik081,

Thank you for removing the image.

Regarding the flow, that's what I'm trying to do, but I get this error on the /token api: { "error": "unsupported_grant_type" }

I'm sending the same exact request as the browser but still getting an error :/

Samik081 commented 7 months ago

@ezescigo Over a month has elapsed, so I trust you've successfully obtained the token by now.

Regarding the error, it's likely that you used an identical request with the same code, which is single-use in OAuth.

This issue isn't directly related to this plugin, so I'll be closing it. However, if you require further assistance, feel free to reach me at <my_GH_username>[at]pm.me.