[PR #220] [CLOSED] Add the ability to use custom headers for OAuth 2.0 #576

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

📋 Pull Request Information

Original PR: https://github.com/OAuthSwift/OAuthSwift/pull/220
Author: @jwrigh26
Created: 4/5/2016
Status: Closed

Base: masterHead: enhancement-headers


📝 Commits (1)

  • 6fb6c1b Added the ability to attach a dictionary of values for custom headers when using OAuth2.

📊 Changes

2 files changed (+17 additions, -0 deletions)

View changed files

📝 OAuthSwift/OAuth2Swift.swift (+13 -0)
📝 OAuthSwift/OAuthSwiftCredential.swift (+4 -0)

📄 Description

Some 3rd party APIs that use OAuth 2.0 sometimes require specific headers. For example: Map My Run (https://developer.underarmour.com/docs/v71_OAuth_2_Intro).

Therefore to tailor to a broad range of APIs, the following pull request adds the ability to init an OAuth2Swift object with custom headers. If the custom headers are found, the OAuthSwiftCredential uses those instead of the default.

To make it possible to include custom headers, Inside the OAuth2Swift class, two public convenience initializers where added.

The following approach is one of many ways to add the ability for a user of this library to implement custom headers. If the following style is not regarded as acceptable, I'm very open to other means. I am mainly submitting this PR in hopes that the creator and contributors will acknowledge that freedom of allowing one to provide custom headers could allow many more possibilities when using this library.

This branch has been tested with MapMyRun and Fitbit2. I realize that Fitbit2 already worked out of the box, but wanted to test with more than one API.


🔄 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/220 **Author:** [@jwrigh26](https://github.com/jwrigh26) **Created:** 4/5/2016 **Status:** ❌ Closed **Base:** `master` ← **Head:** `enhancement-headers` --- ### 📝 Commits (1) - [`6fb6c1b`](https://github.com/OAuthSwift/OAuthSwift/commit/6fb6c1b0ec99a309bcebcb50f07ee30d2969adcf) Added the ability to attach a dictionary of values for custom headers when using OAuth2. ### 📊 Changes **2 files changed** (+17 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `OAuthSwift/OAuth2Swift.swift` (+13 -0) 📝 `OAuthSwift/OAuthSwiftCredential.swift` (+4 -0) </details> ### 📄 Description Some 3rd party APIs that use OAuth 2.0 sometimes require specific headers. For example: Map My Run (https://developer.underarmour.com/docs/v71_OAuth_2_Intro). Therefore to tailor to a broad range of APIs, the following pull request adds the ability to init an OAuth2Swift object with custom headers. If the custom headers are found, the OAuthSwiftCredential uses those instead of the default. To make it possible to include custom headers, Inside the OAuth2Swift class, two public convenience initializers where added. The following approach is one of many ways to add the ability for a user of this library to implement custom headers. If the following style is not regarded as acceptable, I'm very open to other means. I am mainly submitting this PR in hopes that the creator and contributors will acknowledge that freedom of allowing one to provide custom headers could allow many more possibilities when using this library. This branch has been tested with MapMyRun and Fitbit2. I realize that Fitbit2 already worked out of the box, but wanted to test with more than one API. --- <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:31 +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#576
No description provided.