We are currently in the process of developing a range of SharePoint applications which will have mobile apps alongside them which connect to the SharePoint site.

We are having a few issues getting authentication to work on the mobile (iOS) side of things to work.

In development we have been able to define our own SharePoint Online URL for user authentication but in an actual release this wouldn't work since each user will have their own AD in their own Office 365 tenancy (which also means a different SP site URL).

Ideally we don't want to have to make users enter the site URL (although this is an option if needed). The applications are SharePoint Online only if that makes a difference.

Is there anyway that we can have the user login with their Office 365 credentials, then get their original office 365 domain (xxxx.sharepoint.com) returned or something similar?

Ideally we want a user to be able to pick up their phone, login with their Office 365 credentials on the application and then have the application connect to their SharePoint Online deployment automatically.



1 Answer 1


we can have the user login with their Office 365 credentials

No, until user hand them to you himself.

then get their original office 365 domain (xxxx.sharepoint.com) returned or something similar?

Create a remote event receiver, so when an app is installed, it will return with host web URL, which can be done using an hidden app part (maybe) or somehow.

Remote Event receiver for Apps


Remote Event receiver will only work with auto-host apps (As far as I know).

You might want to change logic of your app, as you should develop an auto hosted app, which web services or site hosted on window azure (which is free, I guess if you are Microsoft partner) and then get details from Azure, e.g. then your app will contact windows azure for data operations, if I make any sense.

  • Thanks Muhammad, I didn't really make it clear in the original question but authentication in the SharePoint application itself is fine - what we're trying to develop is login and authentication for a mobile application (iOS/Android/WP). Currently we have to manually provide a site URL for the login to work.
    – Ben Short
    Feb 25, 2014 at 16:59
  • @BenShort If i understood your scenario correctly, you are trying to develop an app for office 365 store, which will be used by 100's or maybe 1000's of clients with different URLs, so as far as I know, you won't going to be able to let your client's login to there specific environment without your mobile app knowing there target url, Feb 25, 2014 at 17:01
  • We are developing applications for the Office 365 app store - but there will also be native mobile applications for iOS, Android and Windows Phone. The applications are auto-hosted and these can locate the host/app context just fine. Our problem is finding a way to do this with a mobile platform such as Android, since most scripts seem to want a hard-coded site URL.
    – Ben Short
    Feb 27, 2014 at 10:26

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.