Question

I am trying to use Office365 APIs in provider hosted app. I created a basic project and when I debug it, it runs perfectly in my local system. After that I hosted it in my Azure website (following Kirk Evans Blog). But now it is giving me Bad Request error when I am accessing it from my Office365 SP developer site.

Any help?

Edit: The app is created using MVC. When we add Office365 API in our project a controller Office365CommonController is added by default. My azure web site is saying https://{sitename}.azurewebsites.net/Office365Common is not valid

It works fine in local host.

Edit: When we add O365 APIs in our MVC project another client id gets created

<add key="ida:ClientID" value="" />

<add key="ida:Password" value="" />

Should we use this client id and password when we register our app on SP or generate a new one?

Was it helpful?

Solution

It looks like you need to update the redirect URI for your Office 365 application. When you are debugging locally, it will be localhost but when you publish the web application, you will need to modify/add redirect URI that matches your website URL. The tooling currently dfo

Also, I see that you are using Office 365 APIs in a provider-hosted app for SharePoint. While this will theoretically work, the SharePoint app registration, auth flow are different to that of Office 365 APIs. They will essentially be two different applications today (until app for SharePoint is also backed with the same AAD auth flow)

Let me know if you have any questions.

OTHER TIPS

Thanks for the question. I have passed this to my team. I will update this once I have some info.

Thanks, Chaks (MSFT) Program Manager, Office 365 API Tooling

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top