Skip to main content

Python PAM for py3/py2

Project description

python-pam
==========

Python pam module supporting py3 (and py2)

Commandline example:

```
[david@Scott python-pam]$ python pam.py
Username: david
Password:
0 Success

[david@Scott python-pam]$ python2 pam.py
Username: david
Password:
0 Success
```

Inline examples:
```
[david@Scott python-pam]$ python
Python 3.4.1 (default, May 19 2014, 17:23:49)
[GCC 4.9.0 20140507 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pam
>>> p = pam.pam()
>>> p.authenticate('david', 'correctpassword')
True
>>> p.authenticate('david', 'badpassword')
False
>>> p.authenticate('david', 'correctpassword', service='login')
True
>>> p.authenticate('david', 'correctpassword', service='unknownservice')
False
>>> p.authenticate('david', 'correctpassword', service='login', resetcreds=True)
True
>>> p.authenticate('david', 'correctpassword', encoding='latin-1')
True
>>> print('{} {}'.format(p.code, p.reason))
0 Success
>>> p.authenticate('david', 'badpassword')
False
>>> print('{} {}'.format(p.code, p.reason))
7 Authentication failure
>>>
```

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

python-pam-1.8.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

python_pam-1.8.1-py3.4.egg (7.1 kB view details)

Uploaded Egg

File details

Details for the file python-pam-1.8.1.tar.gz.

File metadata

  • Download URL: python-pam-1.8.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-pam-1.8.1.tar.gz
Algorithm Hash digest
SHA256 07cca41e5ddacbba27ee30f9aabcd38407a16681d841a87059765890603d4d53
MD5 9a07139fea29e8dae66f5bc37d830a74
BLAKE2b-256 46e4fa7aea814a696a0b84fa12040ff830af7e4f2c9014255c54ce8eb0a0dc20

See more details on using hashes here.

File details

Details for the file python_pam-1.8.1-py3.4.egg.

File metadata

File hashes

Hashes for python_pam-1.8.1-py3.4.egg
Algorithm Hash digest
SHA256 4431c64b0ee6c9e7b3bf08f92b2364925b38893d700ace87be88f2c21c88bc28
MD5 38ca375e9c72c96aac97593149c2a267
BLAKE2b-256 8cde99f8d90fa7c0cf618260534cb96d022493d8958d86e21dc3438e4ed7865b

See more details on using hashes here.

Supported by

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