Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] how to use authorizeSSO? #358

Closed
zunda-pixel opened this issue Jan 6, 2022 · 2 comments
Closed

[Question] how to use authorizeSSO? #358

zunda-pixel opened this issue Jan 6, 2022 · 2 comments

Comments

@zunda-pixel
Copy link

Below code doesn't show authorization View in Official Twitter app.

how to use authorizeSSO?

maybe demo app doesn't work with SSO.

import SwiftUI
import Swifter

struct ContentView: View {
  let consumerKey = "fake"
  let consumerSecret = "fake"
  
  func getOauthToken() {
    let swifter = Swifter(consumerKey: consumerKey, consumerSecret: consumerSecret)
    
    let swifterFailureHandler: Swifter.FailureHandler = { error in
      print(error)
    }
    
    let swifterSuccessHandler: Swifter.SSOTokenSuccessHandler = { json in
      print(json)
    }

    swifter.authorizeSSO(success: swifterSuccessHandler, failure: swifterFailureHandler)
  }
  
  var body: some View {
    Button("Login with Twitter") {
      getOauthToken()
    }
  }
}
@zunda-pixel
Copy link
Author

twitterauth://authorize?consumer_key=xxx&consumer_secret=yyy&oauth_callback=zzz doesn't show authorization View.
without oauth_callback twitterauth://authorize?consumer_key=xxx&consumer_secret=yyydoes show authorization View.

@zunda-pixel
Copy link
Author

same issue #346

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant