1

I am working on developing my app using a company's web service API.

When registering for the API key, the company require me to submit a redirect URI.

It is easy to display a web page in my IOS app and send the user to authorization server and let them grant me the access, but I cannot figure out how to obtain an URI of my own Iphone + the port of my app so the authorization server can send back access token to my application.

Is there a different way to deal with OAuth 2.0 in mobile application without setting a web server and use its URI as a redirect URI ?

I could not find any related issue on Stack Overflow. Please send me some links if there exist a solution for this.

Thank you.

1
  • This link is a great solution to this problem ( it is also compatible with IOS 5.1 and XCode 4.3 ) The example app use Google GTM OAuth2 also solve the problem of wiring the xib of this library to the main story board. singly.com/getting_started_ios Commented Jul 24, 2012 at 21:51

2 Answers 2

3

The best way is to register a custom URI scheme for your app and then set your custom URI as redirect URI. Your browser then gets redirected there and ios calls your app.

There are also other methods e.g. at Google, but most of them have to be supported by your provider.

Sign up to request clarification or add additional context in comments.

2 Comments

Hi Jan, thanks for the great response. Do you know the listener method that can intercept the part when the browser gets redirected?
Checkout this tutorial or the official documentation. Since iOS 4.2 it's application:openURL:sourceApplication:annotation:.
1

This link is a great solution to this problem ( it is also compatible with IOS 5.1 and XCode 4.3 )

The example app use Google GTM OAuth2 also solve the problem of wiring the xib of this library to

https://singly.com/getting_started_ios

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.