1

I am trying to understand if the C# CSOM functionality supports 2 factor authentication using MFA (multi Factor Authentication), when providing a username and password. Will this still work with MFA, or do I need to use another approach. All my searching on the web has found very sparse information on this.

I would expect in the ideal world that the CSOM request would block until it receives the appropriate verification?

Our current implementation uses this code to get an authentication cookie

public string Authenticate(LoginDetails loginDetails)
        {
            SecureString securePassword = new SecureString();
            foreach (var c in loginDetails.Password)
            {
                securePassword.AppendChar(c);
            }
            SharePointOnlineCredentials credentials = new SharePointOnlineCredentials(loginDetails.UserName, securePassword);
            return credentials.GetAuthenticationCookie(new Uri(loginDetails.SiteUrl));
        }

The main problem is if we turn on MFA will this work or will we need to try another means of authenticating. Is there an OAuth approach through active director to SharePoint that works? again haven't found much online.

If anyone could help and provide appropriate links or code that would be greatly appreciated.

Andrew
  • 2,571
  • 2
  • 31
  • 56

1 Answers1

0

The approach I mentioned would not have worked for the web api as the mobile application would need to get the token and then pass that to the api, I figured this out in this post.

C# CSOM Sharepoint Bearer request from azure active directory

Andrew
  • 2,571
  • 2
  • 31
  • 56