mercredi 28 septembre 2016

Access Sharepoint Docuemnts of logged-in user

I have a MVC application where a list of users can upload files to GoogleDrive/DropBox and for this they just need to authenticate themselves and the corresponding api provides an 'AccessToken' or something which is further used to upload files to user account from my web application.

Now I need to do same thing with Microsoft Sharepoint. For testing I created an account there and can get the ClientContext like this

public void GetSharePointContext()
    {
        using (ClientContext context = new ClientContext("http://ift.tt/1nx25wI"))
        {
            context.Credentials = new NetworkCredential("anil.dutt@test.onmicrosoft.com", "somepassword", "https://test.dev.com/");
            List list = context.Web.Lists.GetByTitle("Some List");
            context.ExecuteQuery();

            // Now update the list.
        }
    }

Now I want to make user who logged into my app, can do same.

So in case of Microsoft Sharepoint what can I do to authenticate the logged in user on Sharepoint account and get his/her site url to get documents and perform upload/download etc.

For this i will open a sharepoint window where user will login but how to get Site URL like 'http://ift.tt/1nx25wI'.

Please advice

Aucun commentaire:

Enregistrer un commentaire