Skip to content

Instantly share code, notes, and snippets.

@thisiskeanyvy
Last active July 31, 2022 20:15
Show Gist options
  • Save thisiskeanyvy/6c46dc623c2528dae6314e17c2d48489 to your computer and use it in GitHub Desktop.
Save thisiskeanyvy/6c46dc623c2528dae6314e17c2d48489 to your computer and use it in GitHub Desktop.
Un script pour se connecter à l'ent via une requête POST
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
# remove ssl certificate
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
# ent login
username=""
password=""
def auth():
url = 'https://ent.iledefrance.fr/auth/login'
login_data = {'email': username, 'password': password}
try:
connect = requests.Session()
connect.post(url, verify=False, data=login_data)
get_data = connect.get(url)
except:
print("Request cannot be send...")
if "Authentification" not in str(get_data.content):
print("Connected")
elif "Authentification" in str(get_data.content):
print("Not Connected")
else:
print("Error please retry...")
if __name__ == "__main__":
auth()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment