mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 20:55:57 +03:00
[PR #220] [CLOSED] Add the ability to use custom headers for OAuth 2.0 #576
Labels
No labels
bug
cocoapod
duplicate
enhancement
feature-request
help wanted
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/OAuthSwift#576
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/OAuthSwift/OAuthSwift/pull/220
Author: @jwrigh26
Created: 4/5/2016
Status: ❌ Closed
Base:
master← Head:enhancement-headers📝 Commits (1)
6fb6c1bAdded 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.