oarepo Kerberos
Library that handles the kerberos authentication
Local Setup
Go to setup_local_kdc folder
-
docker build -t custom-kerberos-kdc .
-
docker run -d --name kerberos-kdc -p 2222:88 -p 2223:464 custom-kerberos-kdc
-
docker exec -it kerberos-kdc /bin/bash
-
kadmin.local -q "addprinc admin/admin@EXAMPLE.COM" (choose password)
-
kadmin.local -q "addprinc user@EXAMPLE.COM" (choose password)
-
kadmin.local -q "addprinc -randkey HTTP/localhost@EXAMPLE.COM"
-
kadmin.local -q "ktadd -k /etc/krb5kdc/flask.keytab HTTP/localhost@EXAMPLE.COM"
-
docker cp kerberos-kdc:/etc/krb5kdc/flask.keytab ./flask.keytab
-
Setup env variable
KRB5_KTNAMEto location of flask.keytab and setapp.config['GSSAPI_HOSTNAME'] = 'localhost' -
change/create file
/etc/krb5.confto orexport KRB5_CONFIG=./setup_local_kdc/krb5-client.conf:
[libdefaults]
default_realm = EXAMPLE.COM
dns_lookup_kdc = false
dns_lookup_realm = false
ticket_lifetime = 24h
renew_lifetime = 7d
forwardable = true
[realms]
EXAMPLE.COM = {
kdc = localhost:2222
admin_server = localhost:2223
}
[domain_realm]
.example.com = EXAMPLE.COM
example.com = EXAMPLE.COM
- kinit user@EXAMPLE.COM or another username created in step 5
Limitations
Multi-leg SPNEGO is not supported
Authentication must complete in a single round trip. The negotiation cannot be resumed either — a fresh GSSAPI security context is built per request, and the continuation token is discarded unless that context completed — so a request needing a second leg is answered with 501 Not Implemented.
A session cookie and a Negotiate token cannot be combined
Successful Kerberos authentication logs the user in, which sets a session cookie. If a client
then sends that cookie and Authorization: Negotiate ... on a later request, it is presenting
two credentials that may name different principals, so the server refuses with 400 Bad
Request rather than silently picking one.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oarepo_kerberos-0.1.0.tar.gz.
File metadata
- Download URL: oarepo_kerberos-0.1.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d184bf34bd1135d9242de920cde13029a1995e313849fdb43734b36a36fcb6d
|
|
| MD5 |
cc8c4deb18e66002075c11a936648081
|
|
| BLAKE2b-256 |
976015c4654dcd2df25a152ce98dbbc5420994ca734f3ed50ec388e0765ba72d
|
File details
Details for the file oarepo_kerberos-0.1.0-py3-none-any.whl.
File metadata
- Download URL: oarepo_kerberos-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd2537e39655d94a873b5453109b6685750f4afeb75d5c88bba81742297510e2
|
|
| MD5 |
08456b6cffdcc8b2309163f0142538d0
|
|
| BLAKE2b-256 |
9f9f654ed3908ecd1172fc0822659f7741add386ed23d2ed2f690623863d69b6
|