Skip to content

Instantly share code, notes, and snippets.

@vgrem
Created November 10, 2015 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vgrem/30391ddac67c6e6b7516 to your computer and use it in GitHub Desktop.
Save vgrem/30391ddac67c6e6b7516 to your computer and use it in GitHub Desktop.
public static SharePointOnlineCredentials GetCredentials(Uri webUri, string userName, string password)
{
var securePassword = new SecureString();
foreach (var ch in password) securePassword.AppendChar(ch);
return new SharePointOnlineCredentials(userName, securePassword);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment