Skip to main content

A small utility class for using Kerberos authentication with Python requests

Project description

krtc

This is a very small utility class for using Kerberos authentication with Python requests.

Installation

$ pip install lcls-krtc
$ conda install -c conda-forge krtc

Usage example

To use this when making calls to a web service:

import requests
from krtc import KerberosTicket
from urllib.parse import urlparse

ws_url = "https://ws.slac.stanford.edu/ws/getData.json"
krbheaders = KerberosTicket("HTTP@" + urlparse(ws_url).hostname).getAuthHeaders()
r = requests.get(ws_url, headers=krbheaders)
print(r.json())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lcls-krtc-0.3.0.tar.gz (14.2 kB view hashes)

Uploaded Source

Built Distribution

lcls_krtc-0.3.0-py3-none-any.whl (8.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page