[PR #283] [MERGED] Invalid oauth_signature #594

Closed
opened 2026-03-03 16:49:37 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OAuthSwift/OAuthSwift/pull/283
Author: @ktakayama
Created: 10/5/2016
Status: Merged
Merged: 10/5/2016
Merged by: @phimage

Base: swift2.2Head: swift2.2


📝 Commits (2)

📊 Changes

2 files changed (+21 additions, -1 deletions)

View changed files

📝 OAuthSwift/OAuthSwiftCredential.swift (+6 -1)
📝 OAuthSwiftTests/SignTests.swift (+15 -0)

📄 Description

  • OAuthSwift version: maybe all versions

The OAuth spec says to sort query parameter for generating oauth_signature.

httpy://oauth.net/core/1.0a/#anchor13

9.1.1. Normalize Request Parameters

Parameters are sorted by name, using lexicographical byte value ordering. If two or more parameters share the same name, they are sorted by their value.

So oauth_signature generated by OAuthSwift will be difference other oauth provider.
For example:

  • query parameters (dictionary): [ "id_2": 2, "id_10": 0, "id_1": 1 ]
  • sorted by OAuthSwift: id_10=0&id_1=1&id_2=2
  • expected result: id_1=1&id_10=0&id_2=2

🔄 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/OAuthSwift/OAuthSwift/pull/283 **Author:** [@ktakayama](https://github.com/ktakayama) **Created:** 10/5/2016 **Status:** ✅ Merged **Merged:** 10/5/2016 **Merged by:** [@phimage](https://github.com/phimage) **Base:** `swift2.2` ← **Head:** `swift2.2` --- ### 📝 Commits (2) - [`4790458`](https://github.com/OAuthSwift/OAuthSwift/commit/47904582fd16af729805c1c89d3738c2c077fbff) Quick fix generating invalid signature - [`29a99cd`](https://github.com/OAuthSwift/OAuthSwift/commit/29a99cd2e213a3ca5ec965dc339819a33c738503) Add test for 47904582fd16af729805c1c89d3738c2c077fbff ### 📊 Changes **2 files changed** (+21 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `OAuthSwift/OAuthSwiftCredential.swift` (+6 -1) 📝 `OAuthSwiftTests/SignTests.swift` (+15 -0) </details> ### 📄 Description - **OAuthSwift version:** maybe all versions The OAuth spec says to sort query parameter for generating oauth_signature. httpy://oauth.net/core/1.0a/#anchor13 > **9.1.1. Normalize Request Parameters** > > Parameters are sorted by name, using lexicographical byte value ordering. If two or more parameters share the same name, they are sorted by their value. So oauth_signature generated by OAuthSwift will be difference other oauth provider. For example: - query parameters (dictionary): [ "id_2": 2, "id_10": 0, "id_1": 1 ] - sorted by OAuthSwift: `id_10=0&id_1=1&id_2=2` - expected result: `id_1=1&id_10=0&id_2=2` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 16:49:37 +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/OAuthSwift#594
No description provided.