Question

I'm developping for CRM 2011 and I have to get the files in a SharePoint library. I'm able to get the files, but my problem is to hide the password in the code.

here my code :

string password = "password";
SecureString securePassword = new SecureString();
for (int g = 0; g < password.Length; g++)
  securePassword.AppendChar(password[g]);
ClientContext ctx = new ClientContext(url);
ctx.Credentials = new NetworkCredential("login", securePassword, "Foo");

return ctx;

I also tried with ctx.Credentials = CredentialCache.DefaultNetworkCredentials; but the user don't have the rights for the SharePoint Library.

Anyone has a solution to hide the password?

Thanks!

Was it helpful?

Solution

Create a custom entity called "SharePoint Config" with username and password. When a record is created encrypt the password using a plugin / JavaScript. From your custom workflow code get the password using the username from the "SharePoint Config" and decrypt the password.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top