Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

How to communicate with Office365-sharepoint 2013 resources from azure hosted asp.net webapi ??

$
0
0

I wanted to create  a custom asp.net WebApi that should communicate with office365 SharePoint 2013 site.

In GET Method, I wrote a below code snippet and hosted to local IIS(Executed from VS 2012) and its communicating with SharePoint site smoothly. If I host the same Webapi to windows Azure, Client context is not initializing with the below code. Does it requires any Token services ? If yes, how to generate custom access token ?

ClientContext clientContext = new ClientContext("siteUrl");
SecureString secureString = new SecureString();
string password = "password";
foreach (char c in password)
secureString.AppendChar(c);
clientContext.Credentials = new SharePointOnlineCredentials(userName, secureString);
clientContext.ExecuteQuery(); 


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>