mirror of
https://github.com/OAuthSwift/OAuthSwift.git
synced 2026-04-26 12:45:52 +03:00
[GH-ISSUE #377] Add client_credential grant_type #243
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#243
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?
Originally created by @AlexanderPetrovichev on GitHub (May 25, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/377
Description:
I'm developing iPhone SDK for my server with oauth and I need client_credentials authorization.
I found this method
open func authorize(deviceToken deviceCode: String, success: @escaping TokenRenewedHandler, failure: @escaping OAuthSwiftHTTPRequest.FailureHandler) -> OAuthSwiftRequestHandle? {
var parameters = OAuthSwift.Parameters()
parameters["client_id"] = self.consumerKey
parameters["client_secret"] = self.consumerSecret
parameters["code"] = deviceCode
parameters["grant_type"] = "http://oauth.net/grant_type/device/1.0"
And if I change
parameters["grant_type"] = "http://oauth.net/grant_type/device/1.0"
to
parameters["grant_type"] = "client_credentials"
authorization will work.
But since I want to distribute my SDK to another developers I need some way to add this functionality to master. Or can you offer me another way to set client_credentials into grant_type field?
OAuth Provider (Twitter, Github, ..):
Other
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
8.0 (Swift 3.0)
8.0 (Swift 2.3)
7.3.1
other: (Please fill in the version you are using.)
objective c
@phimage commented on GitHub (Jun 4, 2017):
you can know specify grantType in function parameters
next time try to make a PR