Sharepoint Online - CSOM - authenticate using integrated authentication

292 views Asked by At

I'm in the migration process from Sharepoint 2010 on-premises to Sharepoint Online.

I'have Office Addins which uses web methods which have code CSOM to work with Sharepoint online. The webservice is hosted in IIS with NTLM integrated security in a Windows 2016 domain. This domain is synced with AzureAD, and we have "single signon" configured.

I need automatically authenticate with SPS the user which is working with the Office Addin. I already test the code using this:

ClientContext lContext = new ClientContext(xsSiteURL);
        lContext.AuthenticationMode = ClientAuthenticationMode.Default;
        SecureString passWord = new SecureString();
        foreach (char c in "pass".ToCharArray()) passWord.AppendChar(c);
        lContext.Credentials = new SharePointOnlineCredentials("[email protected]", passWord);

Thats works fine, but I need something like this:

    ClientContext lContext = new ClientContext(xsSiteURL);
    lContext.AuthenticationMode = ClientAuthenticationMode.Default;
    ***lContext.Credentials = System.Net.CredentialCache.DefaultCredentials;***

So: user authenticated in his PC with Office, CALL webservice (IIS), CALL Sharepoint Online

How I could authenticate automatically with integrated security?

0

There are 0 answers