title: Authentication error with Sharepoint API Python Office365 - KeyError: 'FedAuth'
body: <p>I am trying to connect to Sharepoint using the following code and get KeyError: 'FedAuth'.
  My goal is to get access to online Sharepoint through the API to read some xlsx files.
  I tried all the open/close topic that I found here, but I get the same error every time</p>
  <pre><code>#import all the libraries
  from office365.runtime.auth.authentication_context import AuthenticationContext
  from office365.sharepoint.client_context import ClientContext
  from office365.sharepoint.files import file
  
  #target url taken from sharepoint and credentials
  ctx_auth = AuthenticationContext(url)
  if ctx_auth.acquire_token_for_user(username, password):
    ctx = ClientContext(url, ctx_auth)
    web = ctx.web
    ctx.load(web)
    ctx.execute_query()
    print(&quot;Authentication successful&quot;)
  </code></pre>
  <pre><code>An error occurred while retrieving token from XML response: AADSTS90023: Invalid STS request.
  Traceback (most recent call last):
    File &quot;/home/tacohen/ws-test/test/software-repo/devops/icetest/Office365-script.py&quot;, line 28, in &lt;module&gt;
      if ctx_auth.acquire_token_for_user(username, password):
    File &quot;/usr/local/lib/python3.6/dist-packages/office365/runtime/auth/authentication_context.py&quot;, line 47, in acquire_token_for_user
      if not self.provider.acquire_token():
    File &quot;/usr/local/lib/python3.6/dist-packages/office365/runtime/auth/providers/saml_token_provider.py&quot;, line 68, in acquire_token
      return self._acquire_authentication_cookie(token, user_realm.IsFederated)
    File &quot;/usr/local/lib/python3.6/dist-packages/office365/runtime/auth/providers/saml_token_provider.py&quot;, line 232, in _acquire_authentication_cookie
      self._auth_cookies[name] = cookies[name]
  KeyError: 'FedAuth'
  </code></pre>