Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-module-privacyidea-pam
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Eugene Omelyanovich
python-module-privacyidea-pam
Commits
11d2ec56
Commit
11d2ec56
authored
May 02, 2015
by
Cornelius Kölbel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add support for python-requests < 1.0
parent
b04e2738
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
privacyidea_pam.py
privacyidea_pam.py
+10
-1
No files found.
privacyidea_pam.py
View file @
11d2ec56
...
...
@@ -34,6 +34,7 @@ import syslog
import
sqlite3
import
passlib.hash
import
time
import
traceback
def
_get_config
(
argv
):
...
...
@@ -93,7 +94,14 @@ def pam_sm_authenticate(pamh, flags, argv):
response
=
requests
.
post
(
URL
+
"/validate/check"
,
data
=
data
,
verify
=
sslverify
)
json_response
=
response
.
json
()
try
:
json_response
=
response
.
json
()
syslog
.
syslog
(
syslog
.
LOG_DEBUG
,
"requests > 1.0"
)
except
:
# requests < 1.0
json_response
=
response
.
json
syslog
.
syslog
(
syslog
.
LOG_DEBUG
,
"requests < 1.0"
)
result
=
json_response
.
get
(
"result"
)
auth_item
=
json_response
.
get
(
"auth_items"
)
serial
=
json_response
.
get
(
"detail"
,
{})
.
get
(
"serial"
,
...
...
@@ -117,6 +125,7 @@ def pam_sm_authenticate(pamh, flags, argv):
rval
=
pamh
.
PAM_SYSTEM_ERR
except
Exception
as
exx
:
syslog
.
syslog
(
syslog
.
LOG_ERR
,
traceback
.
format_exc
())
syslog
.
syslog
(
syslog
.
LOG_ERR
,
"
%
s:
%
s"
%
(
__name__
,
exx
))
rval
=
pamh
.
PAM_AUTH_ERR
except
requests
.
exceptions
.
SSLError
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment