[GH-ISSUE #363] doing a implicit grant #232

Closed
opened 2026-03-03 16:46:54 +03:00 by kerem · 5 comments
Owner

Originally created by @oshitub123 on GitHub (Apr 19, 2017).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/363

Description:

OAuth Provider (Twitter, Github, ..):

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 @oshitub123 on GitHub (Apr 19, 2017). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/363 ### Description: ### OAuth Provider (Twitter, Github, ..): ### OAuth Version: - [ ] Version 1 - [ ] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [ ] WatchOS : ### Installation method: - [ ] Carthage - [x] CocoaPods - [x] Manually ### Library version: - [ ] head - [x] 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 2026-03-03 16:46:54 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

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

I wants to do an authorization with OAuthSwift with a implicit grant
this is my code

import UIKit
import OAuthSwift
class ViewController: UIViewController,UIApplicationDelegate {

override func viewDidLoad() {
    super.viewDidLoad()
    
    
  let  oauthswift = OAuth2Swift(
        consumerKey:    "********",
        consumerSecret: "********",
        authorizeUrl:   "https://api.instagram.com/oauth/authorize",
        responseType:   "token"
    
    )
    let handle = oauthswift.authorize(
        withCallbackURL: URL(string: "oauth-swift://oauth-callback/instagram")!,
        scope: "likes+comments", state:"INSTAGRAM",
        success: { credential, response, parameters in
           
            print("\(credential.oauthToken) \n ")
    },
        failure: { error in
            print(error.localizedDescription)
            
    }
    )


}

}
<!-- gh-comment-id:295470220 --> @oshitub123 commented on GitHub (Apr 19, 2017): I wants to do an authorization with OAuthSwift with a implicit grant this is my code import UIKit import OAuthSwift class ViewController: UIViewController,UIApplicationDelegate { override func viewDidLoad() { super.viewDidLoad() let oauthswift = OAuth2Swift( consumerKey: "********", consumerSecret: "********", authorizeUrl: "https://api.instagram.com/oauth/authorize", responseType: "token" ) let handle = oauthswift.authorize( withCallbackURL: URL(string: "oauth-swift://oauth-callback/instagram")!, scope: "likes+comments", state:"INSTAGRAM", success: { credential, response, parameters in print("\(credential.oauthToken) \n ") }, failure: { error in print(error.localizedDescription) } ) } }
Author
Owner

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

what i have to change for to do a implicit grant and get my accestoken

<!-- gh-comment-id:295470495 --> @oshitub123 commented on GitHub (Apr 19, 2017): what i have to change for to do a implicit grant and get my accestoken
Author
Owner

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

No description, no provider , ...
Too much message...do only one. You must edit messages

You have a bug
oauthswift object must be retain , for instance as class attribute

<!-- gh-comment-id:295574596 --> @phimage commented on GitHub (Apr 20, 2017): No description, no provider , ... Too much message...do only one. You must edit messages You have a bug oauthswift object must be retain , for instance as class attribute
Author
Owner

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

i need to save my token for to use an api rest but i dont know how return from the broswer to the aplication and getting that token

<!-- gh-comment-id:295760976 --> @oshitub123 commented on GitHub (Apr 20, 2017): i need to save my token for to use an api rest but i dont know how return from the broswer to the aplication and getting that token
Author
Owner

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

so you do no read the readme...

look for "Make signed request"
or use "credential.oauthToken" and sign your own request

please do not open an other issue for same question, only if different topic

<!-- gh-comment-id:295767242 --> @phimage commented on GitHub (Apr 20, 2017): so you do no read the readme... look for "Make signed request" or use "credential.oauthToken" and sign your own request please do not open an other issue for same question, only if different topic
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#232
No description provided.