Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > API Authentication >

OAuth with iOS / Java app

Started by Ken Divelbess -   in API Authentication

Greetings Community -

I have an iOS (Swift 3.0) app that sends data to a Java server. I would now like to access a Xero account to A) retrieve and display contacts in the iOS app and B) send data to populate a quote.

Which of the below approaches to OAuth will work / is recommended?

A) iOS app calls Xero identity server and code is sent back to iOS app. If so, what is the callback URL?
B) iOS app calls Xero identity server and code is sent to Java app. Java server completes authentication and iOS app can access what it needs through the Java server
C) iOS app calls Xero and uses a webview or opens Safari to complete standard authorization, which by extension (not sure how) grants authorization to the iOS app


Thank you!
Hi Ken

We do have a PKCE flow for desktop and mobile apps. Mobile clients should use Claimed HTTPS Scheme URI Redirection to register https redirect URIs. This is supported on both Android and iOS.
https://developer.xero.com/documentation/guides/oauth2/pkce-flow#xero-tenants
https://ldapwiki.com/wiki/Claimed%20Https%20Scheme%20URI%20Redirection
 

Sally C (Community Manager)  

Thank you - further to your response, I've posted a request for developer here:

https://community.xero.com/developer/discussion/145378852/
 

Ken Divelbess  

Hi @ken

My team has developed PKCE flow for iOS native app and shared downloadable code for community.

https://satvasolutions.com/latest-guide-on-oauth-2-0-integration-with-native-ios-app-using-pkce

hoping above is useful to community.
 

Chintan Prajapati