I’m working my way through the OAuth 1.0 flow on an iPhone app.
I have the requestToken. I segue to a UIWebView with the proper URL to perform user authorization of the requestToken, which performs successfully. However, the user has to tap “back” manually after this step is done to get back to the app. The user then taps a separate button to perform the getAccessToken. (this is obviously work in progress).
How do I automate the going back after performing the user authorization of the requestToken? On the UIWebView, when the user successfully logs in, then they get a page verifying permissions, and the user clicks “OK”, I want the app to automatically go back and proceed with getting accessToken once that is complete.
I’m new at this, so may not be explaining this too well. FWIW, I’m working with smugmug APIs. Thanks in advance for any help.
I resolved this by looking for a particular URL, then manually popping the navigationController stack when the right URL finished loading. My code looks something like:
I’m writing to smugmug.com APIs. On token authorization success, they redirect the browser to the callback URL, so that’s what I was looking for.