title: Sharepoint file storage give password expired reason through password not expired using python
body: <p>Unable to upload the file in SharePoint, since yesterday the code is working fine used stored file in Sharepoint now am getting the below error:</p>
  <blockquote>
  <p>Exception: ('Error authenticating against Office 365. Error from
  Office 365:', 'AADSTS50055: The password is expired.')</p>
  </blockquote>
  <p>The same thing happened for the other two accounts even.
  The function <code>uploadMeta_file(filepath_meta)</code> to call Sharepoint</p>
  <blockquote>
  <p>File
  &quot;c:\Users\Desktop\work\sample\cookiepopup-kana-api.venv\lib\site-packages\shareplum\office365.py&quot;,
  line 80, in get_security_token
  raise Exception('Error authenticating against Office 365. Error from Office 365:', message[0].text) Exception: ('Error authenticating
  against Office 365. Error from Office 365:', 'AADSTS50055: The
  password is expired.')</p>
  </blockquote>
  <pre><code>
  import requests
  import jsonpath
  import os, requests, uuid, json
  import pandas as pd
  from shareplum import Office365
  import xlsxwriter
  from shareplum import Site
  from datetime import datetime 
  import logging 
  
  
  
  def kana_api():
      
      writer.save()
      filepath_meta =&quot;kana1_input.xlsx&quot;
      uploadMeta_file(filepath_meta)
      
  
  
      #metadata file
  def uploadMeta_file(filepath_meta): 
  
  
  # working with crentials
      username = &quot;myid
      password = &quot;mypassword&quot;
      site_name = &quot;AFFinance&quot;
      base_path = &quot;validpath&quot;
      doc_library =&quot;validlib&quot;
          
      
      file_name = filepath_meta
      # Obtain auth cookie
      authcookie = Office365(base_path, username=username, password=password).GetCookies()
      session = requests.Session()    
      session.cookies = authcookie
      session.headers.update({'user-agent': 'python_bite/v1'})
      session.headers.update({'accept': 'application/json;odata=verbose'})
  
      session.headers.update({'X-RequestDigest': &quot;FormDigestValue&quot;})
      response = session.post( url=base_path + &quot;/sites/&quot; + site_name + &quot;/_api/web/GetFolderByServerRelativeUrl('&quot; + doc_library + &quot;')/Files/add(url='a.txt',overwrite=true)&quot;,
                                  data=&quot;&quot;)
      logging.info(response)
      session.headers.update({'X-RequestDigest': response.headers['X-RequestDigest']})
      # perform the actual upload
      with open( file_name, 'rb') as file_input:
          try: 
              response = session.post( 
                  url=base_path + &quot;/sites/&quot; + site_name + &quot;/_api/web/GetFolderByServerRelativeUrl('&quot; + doc_library  + &quot;')/Files/add(url='&quot; 
                  + file_name + &quot;',overwrite=true)&quot;,
                  data=file_input)
              logging.info(&quot;Meta File uploaded&quot;)
          except Exception as err: 
              logging.info(&quot;Some error occurred....&quot;)
      
  
  
  if __name__== '__main__':
      kana_api()
  
  </code></pre>