Example for LDAP, new error message and added a test user.
This commit is contained in:
@@ -484,7 +484,9 @@ def do_authentication(environ, start_response, authn_context, key,
|
|||||||
|
|
||||||
# -----------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------
|
||||||
|
|
||||||
PASSWD = {"haho0032": "qwerty",
|
PASSWD = {
|
||||||
|
"daev0001": "qwerty",
|
||||||
|
"haho0032": "qwerty",
|
||||||
"roland": "dianakra",
|
"roland": "dianakra",
|
||||||
"babs": "howes",
|
"babs": "howes",
|
||||||
"upper": "crust"}
|
"upper": "crust"}
|
||||||
|
|||||||
@@ -1,8 +1,45 @@
|
|||||||
USERS = {
|
#from dirg_util.dict import LDAPDict
|
||||||
|
#ldap_settings = {
|
||||||
|
# "ldapuri": "ldaps://ldap.test.umu.se",
|
||||||
|
# "base": "dc=umu, dc=se",
|
||||||
|
# "filter_pattern": "(uid=%s)",
|
||||||
|
# "user": "",
|
||||||
|
# "passwd": "",
|
||||||
|
# "attr": [
|
||||||
|
# "eduPersonScopedAffiliation",
|
||||||
|
# "eduPersonAffiliation",
|
||||||
|
# "eduPersonPrincipalName",
|
||||||
|
# "givenName",
|
||||||
|
# "sn",
|
||||||
|
# "mail",
|
||||||
|
# "uid",
|
||||||
|
# "o",
|
||||||
|
# "c",
|
||||||
|
# "labeledURI",
|
||||||
|
# "ou",
|
||||||
|
# "displayName",
|
||||||
|
# "norEduPersonLIN"
|
||||||
|
# ],
|
||||||
|
# "keymap": {
|
||||||
|
# "mail": "email",
|
||||||
|
# "labeledURI": "labeledURL",
|
||||||
|
# },
|
||||||
|
# "static_values": {
|
||||||
|
# "eduPersonTargetedID": "one!for!all",
|
||||||
|
# },
|
||||||
|
# "exact_match": True,
|
||||||
|
# "firstonly_len1": True,
|
||||||
|
# "timeout": 15,
|
||||||
|
#}
|
||||||
|
#Uncomment to use a LDAP directory instead.
|
||||||
|
#USERS = LDAPDict(**ldap_settings)
|
||||||
|
|
||||||
|
USERS_ = {
|
||||||
"haho0032": {
|
"haho0032": {
|
||||||
"sn": "Hoerberg",
|
"sn": "Hoerberg",
|
||||||
"givenName": "Hans",
|
"givenName": "Hasse",
|
||||||
"eduPersonScopedAffiliation": "staff@example.com",
|
"eduPersonAffiliation": "student",
|
||||||
|
"eduPersonScopedAffiliation": "student@example.com",
|
||||||
"eduPersonPrincipalName": "haho@example.com",
|
"eduPersonPrincipalName": "haho@example.com",
|
||||||
"uid": "haho",
|
"uid": "haho",
|
||||||
"eduPersonTargetedID": "one!for!all",
|
"eduPersonTargetedID": "one!for!all",
|
||||||
|
|||||||
@@ -479,7 +479,8 @@ class Server(Entity):
|
|||||||
if not verify_encrypt_cert(encrypt_cert):
|
if not verify_encrypt_cert(encrypt_cert):
|
||||||
raise CertificateError("Invalid certificate for encryption!")
|
raise CertificateError("Invalid certificate for encryption!")
|
||||||
else:
|
else:
|
||||||
raise CertificateError("No certificate for encryption!")
|
raise CertificateError("No SPCertEncType certificate for encryption contained in authentication "
|
||||||
|
"request.")
|
||||||
else:
|
else:
|
||||||
encrypt_assertion = False
|
encrypt_assertion = False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user