Skip to main content
authkerb
========

Kerberos authentication for Twisted

```python
import os
import sys

from twisted.cred.portal import IRealm, Portal
from twisted.internet import reactor
from twisted.python import log
from twisted.web import server
from twisted.web.guard import HTTPAuthSessionWrapper, BasicCredentialFactory
from twisted.web.resource import IResource, Resource

from zope.interface import implements

import authkerb


class Simple(Resource):
isLeaf = True

def render_GET(self, request):
return '<html>Hello, world!</html>'


class Realm(object):
implements(IRealm)

def requestAvatar(self, avatarId, mind, *interfaces):
if IResource in interfaces:
return (IResource, Simple(), lambda: None)

raise NotImplementedError()


os.environ['KRB5_KTNAME'] = '/path/to/keytab'
log.startLogging(sys.stdout)

negotiateChecker = authkerb.NegotiateCredentialsChecker()
basicChecker = authkerb.BasicCredentialsChecker('HTTP/example.org', 'EXAMPLE.ORG')

portal = Portal(Realm(), [negotiateChecker, basicChecker])

negotiateFactory = authkerb.NegotiateCredentialFactory('HTTP')
basicFactory = BasicCredentialFactory('realm')

resource = HTTPAuthSessionWrapper(portal, [negotiateFactory, basicFactory])
site = server.Site(resource)

reactor.listenTCP(8080, site)
reactor.run()
```

Metadata

Release files for authkerb 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for authkerb 0.1
File Size Uploaded
authkerb-0.1.tar.gz 2.9 kB Details

Release files / authkerb-0.1.tar.gz

Download URL authkerb-0.1.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f68f78dcddf26b456679b6ce1ccf1b774be05e2ff4752efe292b5f43d770fbbd
BLAKE2b-256 checksum
How to use checksums
b74c412a8c2eb8a092e1ebf1ee7b141791cfb3c05ff951cfe209eb8df82777ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page