[PR #420] [MERGED] Fix pkce #443

Closed
opened 2026-02-27 20:24:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ramsayleung/rspotify/pull/420
Author: @jacobmichels
Created: 5/30/2023
Status: Merged
Merged: 5/30/2023
Merged by: @ramsayleung

Base: masterHead: fix-pkce


📝 Commits (5)

📊 Changes

4 files changed (+9 additions, -3 deletions)

View changed files

📝 CHANGELOG.md (+3 -0)
📝 Cargo.toml (+1 -1)
📝 src/auth_code_pkce.rs (+3 -1)
📝 src/lib.rs (+2 -1)

📄 Description

Description

This PR fixes the PKCE auth flow panicking during prompt_for_token. The issue was the challenge code was being base64 encoded in a url-unsafe manner. This PR simply changes the base64 encoding logic to be url safe.

I also bumped the base64 crate version and updated lib.rs to avoid using a deprecated base64 encode API.

#419

Motivation and Context

I wanted to use PKCE auth.

Dependencies

No dependencies added. base64 bumped from 0.20.0 to 0.21.2

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

I didn't do any automated testing, I just ran the auth_code_pkce example to check if my changes worked. On version 0.11.7 this example panics. With my patch, the example functions as expected.

Is this change properly documented?

I added an entry to the changelog. I don't believe further documentation is needed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ramsayleung/rspotify/pull/420 **Author:** [@jacobmichels](https://github.com/jacobmichels) **Created:** 5/30/2023 **Status:** ✅ Merged **Merged:** 5/30/2023 **Merged by:** [@ramsayleung](https://github.com/ramsayleung) **Base:** `master` ← **Head:** `fix-pkce` --- ### 📝 Commits (5) - [`c544786`](https://github.com/ramsayleung/rspotify/commit/c5447866900369a923877be0bcaff71173739e2f) bump base64 to latest - [`b3ac7e3`](https://github.com/ramsayleung/rspotify/commit/b3ac7e3f1ce56240ddb243331c8152bad6d3cdb2) fix usage of deprecated api - [`4360c09`](https://github.com/ramsayleung/rspotify/commit/4360c096f2e1d827bd52b998dc3c1bfde18c456d) properly encode challenge code - [`77fae78`](https://github.com/ramsayleung/rspotify/commit/77fae7822d37f60c62317fe06ba28f7122e0bd22) changelog entry - [`cb0885f`](https://github.com/ramsayleung/rspotify/commit/cb0885f899f4c6748ac7e08caa78d41446151409) change encoding alphabet ### 📊 Changes **4 files changed** (+9 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -0) 📝 `Cargo.toml` (+1 -1) 📝 `src/auth_code_pkce.rs` (+3 -1) 📝 `src/lib.rs` (+2 -1) </details> ### 📄 Description ## Description This PR fixes the PKCE auth flow panicking during `prompt_for_token`. The issue was the challenge code was being base64 encoded in a url-unsafe manner. This PR simply changes the base64 encoding logic to be url safe. I also bumped the base64 crate version and updated lib.rs to avoid using a deprecated base64 encode API. #419 ## Motivation and Context I wanted to use PKCE auth. ## Dependencies No dependencies added. base64 bumped from 0.20.0 to 0.21.2 ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] This change requires a documentation update ## How has this been tested? I didn't do any automated testing, I just ran the auth_code_pkce example to check if my changes worked. On version 0.11.7 this example panics. With my patch, the example functions as expected. ## Is this change properly documented? I added an entry to the changelog. I don't believe further documentation is needed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:24:45 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rspotify#443
No description provided.