Using just a password-based authentication, it's easy to authenticate in CSOM:
context.Credentials = new SharePointOnlineCredentials(username, password);
But how to authenticate when Multi-factor authentication is in place (http://technet.microsoft.com/en-us/library/dn249471.aspx)?
Use an app password in place of your normal one.
Generate an app password here:
https://account.activedirectory.windowsazure.com/AppPasswords.aspx
Or go to
https://portal.office.com/account/#security
and click Additional Security Verification
> Create app password
.
You can always revoke/delete the app password later.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With