old_contents: # lca2018.py
  
  from pprint import pprint
  
  import requests
  
  
  auth = {
          'x_login_page':'https://login.linux.conf.au/idp/profile/SAML2/Redirect/SSO?execution=e2s1',
          'login_page':'https://login.linux.conf.au/manage/private/login',
              'login_data':{
                  'username':'carlfk',
                  'password':'xxxx',
                  'next':'/' }}
  
  schedule_endpoint="http://lca2019.linux.org.au/schedule/conference.json"
  
  session = requests.session()
  session.get(auth['login_page'])
  # token = session.cookies['csrftoken']
  # print( token )
  
  login_data = auth['login_data']
  # login_data['csrfmiddlewaretoken'] = token
  
  ret = session.post(auth['login_page'],
          data=login_data,
          headers={'Referer':auth['login_page']})
  
  print( "ret: {}".format(ret) )
  
  response = session.get(schedule_endpoint)
  # print( response.text[:200] )
  j = response.json()
  pprint( j['schedule'][0]['contact'] )
  schedule =j['schedule']
  for s in schedule:
      if s['contact']:
          pprint( s )
          print( "\ncontact: {}".format(s['contact']) )
          break
  
  
  
  
new_contents: # lca2019.py
  
  import os
  from pprint import pprint
  import requests
  
  auth = {
          'symp_login_page':'https://login.linux.conf.au/idp/profile/SAML2/Redirect/SSO?execution=e2s1',
          'login_page':'https://login.linux.conf.au/manage/private/login',
              'login_data':{
                  'username':'carlfk',
                  'password':os.getenv('pw'),
                  'next':'/' }}
  
  schedule_endpoint="http://lca2019.linux.org.au/schedule/conference.json"
  
  pprint(auth)
  session = requests.session()
  session.get(auth['login_page'])
  # token = session.cookies['csrftoken']
  # print( token )
  
  login_data = auth['login_data']
  # login_data['csrfmiddlewaretoken'] = token
  
  ret = session.post(auth['login_page'],
          data=login_data,
          headers={'Referer':auth['login_page']})
  
  print( "ret: {}".format(ret) )
  
  response = session.get(schedule_endpoint)
  # print( response.text[:200] )
  j = response.json()
  pprint( j['schedule'][0]['contact'] )
  schedule =j['schedule']
  for s in schedule:
      if s['contact']:
          pprint( s )
          print( "\ncontact: {}".format(s['contact']) )
          break
  
  
  
  
subject: use pw=abc to set password in sso test.