• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

python_pam.egg-info/H03-May-2022-7568

LICENSEH A D03-Aug-20141.1 KiB2217

MANIFEST.inH A D16-Jun-201834 32

PKG-INFOH A D16-Jun-20182.5 KiB7568

README.mdH A D03-Aug-20141.1 KiB4842

README.rstH A D03-Aug-20141.1 KiB4842

pam.pyH A D16-Jun-20187.4 KiB225152

setup.cfgH A D16-Jun-201838 53

setup.pyH A D16-Jun-20181.4 KiB3834

README.md

1python-pam
2==========
3
4Python pam module supporting py3 (and py2)
5
6Commandline example:
7
8```
9[david@Scott python-pam]$ python pam.py
10Username: david
11Password:
120 Success
13
14[david@Scott python-pam]$ python2 pam.py
15Username: david
16Password:
170 Success
18```
19
20Inline examples:
21```
22[david@Scott python-pam]$ python
23Python 3.4.1 (default, May 19 2014, 17:23:49)
24[GCC 4.9.0 20140507 (prerelease)] on linux
25Type "help", "copyright", "credits" or "license" for more information.
26>>> import pam
27>>> p = pam.pam()
28>>> p.authenticate('david', 'correctpassword')
29True
30>>> p.authenticate('david', 'badpassword')
31False
32>>> p.authenticate('david', 'correctpassword', service='login')
33True
34>>> p.authenticate('david', 'correctpassword', service='unknownservice')
35False
36>>> p.authenticate('david', 'correctpassword', service='login', resetcreds=True)
37True
38>>> p.authenticate('david', 'correctpassword', encoding='latin-1')
39True
40>>> print('{} {}'.format(p.code, p.reason))
410 Success
42>>> p.authenticate('david', 'badpassword')
43False
44>>> print('{} {}'.format(p.code, p.reason))
457 Authentication failure
46>>>
47```
48

README.rst

1python-pam
2==========
3
4Python pam module supporting py3 (and py2)
5
6Commandline example:
7
8```
9[david@Scott python-pam]$ python pam.py
10Username: david
11Password:
120 Success
13
14[david@Scott python-pam]$ python2 pam.py
15Username: david
16Password:
170 Success
18```
19
20Inline examples:
21```
22[david@Scott python-pam]$ python
23Python 3.4.1 (default, May 19 2014, 17:23:49)
24[GCC 4.9.0 20140507 (prerelease)] on linux
25Type "help", "copyright", "credits" or "license" for more information.
26>>> import pam
27>>> p = pam.pam()
28>>> p.authenticate('david', 'correctpassword')
29True
30>>> p.authenticate('david', 'badpassword')
31False
32>>> p.authenticate('david', 'correctpassword', service='login')
33True
34>>> p.authenticate('david', 'correctpassword', service='unknownservice')
35False
36>>> p.authenticate('david', 'correctpassword', service='login', resetcreds=True)
37True
38>>> p.authenticate('david', 'correctpassword', encoding='latin-1')
39True
40>>> print('{} {}'.format(p.code, p.reason))
410 Success
42>>> p.authenticate('david', 'badpassword')
43False
44>>> print('{} {}'.format(p.code, p.reason))
457 Authentication failure
46>>>
47```
48