Skip to content
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

Is there support for PCKE in the Exchange() method? #129

Open
andrewcretin opened this issue Jun 4, 2020 · 5 comments
Open

Is there support for PCKE in the Exchange() method? #129

andrewcretin opened this issue Jun 4, 2020 · 5 comments

Comments

@andrewcretin
Copy link

I've started receiving errors saying 'invalid code_verifier' on the Exchange method. This worked fine before, but now I am unable to get a valid token from the code.

On the client I am not getting a code_verifier or any other params as apart of the callback url.

Any help is appreciated.

Thanks

@oliveroneill
Copy link

@andrewcretin Did you have any luck working this out? I'm stuck with the same error

@andrewcretin
Copy link
Author

No luck yet. I tried debugging for a while, and couldn't find any updates in Spotify docs so left it until now. Will likely look again this week - surely others are experiencing the same

@FrankMoreno
Copy link
Contributor

I'm working on getting this integrated, will hopefully have something in the next week.

@brianstrauch
Copy link

Old issue, but here's a working implementation of PKCE in a project of mine if anyone's interested. I solved the "invalid code_verifier" issue by trimming the trailing = from the base64url'd hash: https://github.com/brianstrauch/spotify-cli/blob/da00b4b776b5423b2f0dcdb9966f9d0ae73f68ae/pkg/auth.go#L25

@elliotwms
Copy link
Contributor

elliotwms commented Oct 12, 2022

Yes this is possible, there's a working example in examples/pkce however this doesn't demonstrate how to actually generate the verifier or the challenge.

I also got caught by the same invalid_code_verifier issue, which I solved by using RawURLEncoding which doesn't add the = padding. I wrote a pkce package in a recent project which solves this if anyone needs a reference implementation: https://github.com/elliotwms/opml-to-spotify/blob/4fa2b4c472083c3d19337af557d4afb61f6e0e88/pkg/pkce/pkce.go#L44-L49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants