Goodreads Developers discussion
questions
>
OAuth in iOS
date
newest »


I used OAuthSwift and just followed the documentation on their github to get it up and running: https://github.com/OAuthSwift/OAuthSwift

Here you go. The SafariURLHandler function in OAuthSwift creates a SafariViewController for you (you can even set a delegate to it if you want to handle failure states better)
https://gist.github.com/Protome/96756...

I know I am missing something really stupid

Here you go. The SafariURLHandler function in OAuthSwift creates a SafariViewController for you (you can even set..."
Also, what is AuthStorageService in the sample code?
Thanks a lot for doing this.

I know I am missing something really stupid"
That's weird. Have you set up your AppDelegate/info.plist to respond to Return URLs like at the start of the How To section of https://github.com/OAuthSwift/OAuthSwift ? That should allow OAuthSwift to handle it automatically.
Navarjun wrote: "Also, what is AuthStorageService in the sample code?
Thanks a lot for doing this. "
Oh, I created an AuthStorageService that saves the Auth Token & Secret in the keychain and retrieves them again later. It just saves the app needing a login every time it's reopened. I meant to remove it from the gist!

Yes, I did that… but it's not working :(

It worked now… I realised my mistake… there was a typo in the AppDelegate String…
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:]) -> Bool {
if (url.host == "oauth-calback") {
OAuthSwift.handle(url: url)
}
return true
}
callback was spelled calback
Thanks a lot for helping me figure this out.
I am trying to get OAuth work on iOS… I tried a lot, believe me I have been trying since yesterday, and it's already today evening. There is an library that I found, but I cannot use it as it uses deprecated methods… and Apple will reject my app as soon as I submit.
I followed the documentation on OAuth website. There is also a link that I followed:
https://www.cubrid.org/blog/dancing-w...
Can someone document the requests needed to get OAuthorization for goodreads API.
I am looking for following things:
- What requests do I need to make? (and in what order)
- What should be the link I send users to?
- What are the headers/url parameters/body parameters that I need to send for each request?
- What is the "base signature string" for each request?
Thanks in advance!