[GH-ISSUE #104] OAuth2 - client_id != consumer_key ... #69

Closed
opened 2026-03-03 16:45:22 +03:00 by kerem · 1 comment
Owner

Originally created by @peteclark3 on GitHub (Sep 14, 2015).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/104

It seems like your oauth2 code doesn't distinguish between the consumer_key and the client_id. I am trying to use it against Fitbit's oauth2 implementation and because your code treats them as one and the same, I either get an "invalid client_id" error or an "invalid consumer_key" error.

Any plans to distinguish between the two?

Originally created by @peteclark3 on GitHub (Sep 14, 2015). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/104 It seems like your oauth2 code doesn't distinguish between the consumer_key and the client_id. I am trying to use it against Fitbit's oauth2 implementation and because your code treats them as one and the same, I either get an "invalid client_id" error or an "invalid consumer_key" error. Any plans to distinguish between the two?
kerem 2026-03-03 16:45:22 +03:00
  • closed this issue
  • added the
    invalid
    label
Author
Owner

@phimage commented on GitHub (Nov 9, 2015):

For OAuth version 2 only client_id is used by this framework event if the variable is named consumer_key (also named client consumer key, client key sometimes)
see

"client_id=\(self.consumer_key)"
 parameters["client_id"] = self.consumer_key

So if you use OAuth version 2 , use the "Oauth2 client id" into consumerKeyattribute

Only for OAuth version 1, consumer_key is used with this name for authentification header

authorizationParameters["oauth_consumer_key"] = self.consumer_key

The name is the same just to factorize code between the two class

You can comment, I will reopen the issue if necessary
or see #139

<!-- gh-comment-id:155041320 --> @phimage commented on GitHub (Nov 9, 2015): For OAuth version 2 only `client_id` is used by this framework event if the variable is named consumer_key (also named client consumer key, client key sometimes) see ``` swift "client_id=\(self.consumer_key)" parameters["client_id"] = self.consumer_key ``` So if you use OAuth version 2 , use the "Oauth2 client id" into `consumerKey`attribute Only for OAuth version 1, consumer_key is used with this name for authentification header ``` swift authorizationParameters["oauth_consumer_key"] = self.consumer_key ``` The name is the same just to factorize code between the two class You can comment, I will reopen the issue if necessary or see #139
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#69
No description provided.