[GH-ISSUE #329] Custom grant flow #204

Closed
opened 2026-03-03 16:46:38 +03:00 by kerem · 6 comments
Owner

Originally created by @aliasdoc on GitHub (Jan 3, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/329

Description:

Hi,

Is possible to use this library with a custom oath flow ?? For my personal needs, I have an oauth server with a custom grant flow for social login (like password grant flow but with custom params). I need to transmit these JSON params in body:


- grant_type = social
- client_id = ...
- client_secret = ...
- network = Facebook
- access_token ...

and receive a JSON response like this:


- token_type = Bearer
- expires_in = ...
- access_token = ...
- refresh_token = ...

Thanks.

OAuth Provider (Twitter, Github, ..):

I use a custom provider with a custom grant flow (like password grant flow but with custom params) made for social login.

OAuth Version:

  • Version 1
  • Version 2

OS (Please fill the version) :

  • iOS :
  • OSX :
  • TVOS :
  • WatchOS :

Installation method:

  • Carthage
  • CocoaPods
  • Manually

Library version:

  • head
  • v1.0.0
  • v0.6
  • other: (Please fill in the version you are using.)

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

Originally created by @aliasdoc on GitHub (Jan 3, 2017). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/329 ### Description: Hi, Is possible to use this library with a custom oath flow ?? For my personal needs, I have an oauth server with a custom grant flow for social login (like password grant flow but with custom params). I need to transmit these JSON params in body: ``` - grant_type = social - client_id = ... - client_secret = ... - network = Facebook - access_token ... ``` and receive a JSON response like this: ``` - token_type = Bearer - expires_in = ... - access_token = ... - refresh_token = ... ``` Thanks. ### OAuth Provider (Twitter, Github, ..): I use a custom provider with a custom grant flow (like password grant flow but with custom params) made for social login. ### OAuth Version: - [ ] Version 1 - [x] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [ ] WatchOS : ### Installation method: - [ ] Carthage - [x] CocoaPods - [ ] Manually ### Library version: - [x] head - [ ] v1.0.0 - [ ] v0.6 - [ ] other: (Please fill in the version you are using.) ### Xcode version: - [x] 8.0 (Swift 3.0) - [ ] 8.0 (Swift 2.3) - [ ] 7.3.1 - [ ] other: (Please fill in the version you are using.) - [ ] objective c
kerem closed this issue 2026-03-03 16:46:39 +03:00
Author
Owner

@phimage commented on GitHub (Jan 3, 2017):

I think that it is not supported (only Authorization Code grant type or implicit is supported)
You can't provide a Doc link?

<!-- gh-comment-id:270123689 --> @phimage commented on GitHub (Jan 3, 2017): I think that it is not supported (only Authorization Code grant type or implicit is supported) You can't provide a Doc link?
Author
Owner

@aliasdoc commented on GitHub (Jan 3, 2017):

Thank you @phimage, I don't have doc for this flow, it's just a password grant flow customized with username and password parameters renamed by network and access_token. In my app I use two grant flows:

  • Authorization grant flow for getting access_token from social network (Facebook, Twitter, Google and Uber)
  • My custom grant flow for authenticating with my server
<!-- gh-comment-id:270124743 --> @aliasdoc commented on GitHub (Jan 3, 2017): Thank you @phimage, I don't have doc for this flow, it's just a password grant flow customized with username and password parameters renamed by network and access_token. In my app I use two grant flows: - Authorization grant flow for getting access_token from social network (Facebook, Twitter, Google and Uber) - My custom grant flow for authenticating with my server
Author
Owner

@phimage commented on GitHub (Jan 3, 2017):

ok I see
until password grant flow is not supported, I can't provide a way to do this
but when someone or I implement it, I will remember that "username" and "password" parameters name must be customisable

<!-- gh-comment-id:270127526 --> @phimage commented on GitHub (Jan 3, 2017): ok I see until password grant flow is not supported, I can't provide a way to do this but when someone or I implement it, I will remember that "username" and "password" parameters name must be customisable
Author
Owner

@aliasdoc commented on GitHub (Jan 3, 2017):

Thank you @phimage.

<!-- gh-comment-id:270127918 --> @aliasdoc commented on GitHub (Jan 3, 2017): Thank you @phimage.
Author
Owner

@phimage commented on GitHub (Apr 19, 2017):

@oshitub123 do not write into closed issue
this one do not talk about implicit grant...

do some research, implicit grant : response_type: "token"

<!-- gh-comment-id:295144614 --> @phimage commented on GitHub (Apr 19, 2017): @oshitub123 do not write into closed issue this one do not talk about implicit grant... do some research, implicit grant : response_type: "token"
Author
Owner

@oshitub123 commented on GitHub (Apr 21, 2017):

thank you @phimage

<!-- gh-comment-id:296214383 --> @oshitub123 commented on GitHub (Apr 21, 2017): thank you @phimage
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#204
No description provided.