Skip to content

Instantly share code, notes, and snippets.

Last active April 9, 2020 14:18
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
A proof of concept script for authenticating with security API endpoints on
#! /usr/bin/env python3
# Standard library
import os
from http.cookiejar import MozillaCookieJar
# Packages
from macaroonbakery import httpbakery
client = httpbakery.Client(cookies=MozillaCookieJar(".login"))
if os.path.exists(client.cookies.filename):
response = client.request(
"POST", ("http://localhost:8001/security/notices")
print(response, response.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment