Skip to content
Dongri Jin edited this page Aug 26, 2015 · 1 revision

Uber settings

uber redirect url<script async src="//embedr.flickr.com/assets/client-code.js" charset="utf-8"></script>

OAuth

let oauthswift = OAuth2Swift(
    consumerKey:    Uber["consumerKey"]!,
    consumerSecret: Uber["consumerSecret"]!,
    authorizeUrl:   "https://login.uber.com/oauth/authorize",
    accessTokenUrl: "https://login.uber.com/oauth/token",
    responseType:   "code",
    contentType:    "multipart/form-data"
)
let state: String = generateStateWithLength(20) as String
let redirectURL = "https://oauthswift.herokuapp.com/callback/uber".stringByAddingPercentEncodingWithAllowedCharacters(.URLHostAllowedCharacterSet())
oauthswift.authorizeWithCallbackURL( NSURL(string: redirectURL!)!, scope: "profile", state: state, success: {
    credential, response, parameters in
    self.showAlertView("Uber", message: "oauth_token:\(credential.oauth_token)")
    }, failure: {(error:NSError!) -> Void in
        print(error.localizedDescription)
})

Add contentType: "multipart/form-data"

Clone this wiki locally