title: SharePoint Office365 Signin issue using CSOM
body: <p>I am trying to connect and retrieve a List from my Office365 sharepoint portal through CSOM. In document.ready function of jquery I am calling an ajax call.
  I am using the below code and its working fine.</p>
  
  <pre><code>    [WebMethod]
  public static List&lt;myClass&gt; GetDataOnPageLoad()
  {
      List&lt;myClass&gt; objmyClass = new List&lt;myClass&gt;();
      string strSiteCollection = "&lt;Site Url&gt;";
      string login = "&lt;username&gt;";
      string password = "&lt;password&gt;";
      SecureString securePassword = new SecureString();
      foreach (char c in password)
          securePassword.AppendChar(c);
      try
      {
          ClientContext Clientcontext = new ClientContext(strSiteCollection);
          Clientcontext.Credentials = new SharePointOnlineCredentials(login, securePassword);
          DataTable dtData = new DataTable();
          dtData.Columns.Add("ID", typeof(string));
          dtData.Columns.Add("UserEmail", typeof(string));
          dtData.Columns.Add("InstalledVersion", typeof(string));
          if (Clientcontext != null)
          {
              List docList = Clientcontext.Web.Lists.GetByTitle("&lt;List Name&gt;");
              Microsoft.SharePoint.Client.ListItemCollection items = docList.GetItems(CamlQuery.CreateAllItemsQuery());
              Clientcontext.Load(items);
              Clientcontext.ExecuteQuery();
              foreach (var item in items)
                  dtData.Rows.Add(item["ID"].ToString(), item["UserEmail"].ToString(), item["InstalledVersion"].ToString());
          }
          if (dtData != null &amp;&amp; dtData.Rows.Count &gt; 0)
          {
              for (int i = 0; i &lt; dtData.Rows.Count; i++)
              {
                  //binding list
              }
          }
      }
      catch (Exception ex)
      {
  
      }
      return objmyClass;
  }
  </code></pre>
  
  <p>All good till now.</p>
  
  <p>Now I in another project I need this same code.
  So I copied it and pasted in the new project. Included the sharepoint client dll. Calling this from ajax. Now when I am running this new project it gives an exception from Clientcontext.ExecuteQuery();
  Exception says : <strong>The partner returned a bad sign-in name or password error. For more information, see Federation Error-handling Scenarios.</strong></p>
  
  <p>I searched for this error but it didn't helped. I'm running the two projects side by side. The old one is running perfectly but the new one is getting the above said error.
  Please help. Thanks &amp; Regards.</p>