Hi Jochen,
it gets there, but it bails out exactly at this position!
Several years ago I also had to get used to reading the traceback log
of python.
(see below)
Hi Cornelux, My name is Jochen and I am currently evaluating the
product because it seems very versatile :). This is (not yet a
production system)
Any help you give is much appreciated.
I tried your example with the exact same result (the GUID in the
example is also valid on my system). making me think that
str(uuid.UUID(bytes_le=uid)) does not even
get “\x1a\x9f\xc7d\x1c\x88TH\xa5\xf2h’\x8f\rz\xa6”.
And I think I’m right.
I added some extra debugging:
@staticmethod
def _get_uid(entry, uidtype):
uid = None
#log.debug("{0!s}".format(entry))
if uidtype.lower() == "dn":
uid = entry.get("dn")
else:
attributes = entry.get("attributes")
if type(attributes.get(uidtype)) == list:
uid = attributes.get(uidtype)[0]
log.debug("FBTEST {0!s}".format(uid))
else:
uid = attributes.get(uidtype)
log.debug("FBTEST2 {0!s}".format(uid))
# in case: fix the objectGUID
if uidtype == "objectGUID":
uid = str(uuid.UUID(bytes_le=uid))
return uid
And and exmple result is:
[2016-11-14
10:18:12,608][5947][140300436125440][DEBUG][privacyidea.lib.resolvers
.LDAPIdResolver:272] FBTEST2 79fbf2a1-dabf-44cb-a45a-34e891ce10ee
[2016-11-14
10:18:12,609][5947][140300436125440][WARNING][privacyidea.lib.resolve
rs.LDAPIdResolver:718] Error during fetching LDAP objects:
ValueError(‘bytes_le is not a 16-char string’,)
[2016-11-14
10:18:12,609][5947][140300436125440][DEBUG][privacyidea.lib.resolvers
.LDAPIdResolver:719] Traceback (most recent call last):
File “/opt/privacyIDEA/lib/python2.7/site-
packages/privacyidea/lib/resolvers/LDAPIdResolver.py”, line 712, in
testconnection
userid = cls._get_uid(entry, uidtype)
File “/opt/privacyIDEA/lib/python2.7/site-
packages/privacyidea/lib/resolvers/LDAPIdResolver.py”, line 275, in
_get_uid
uid = str(uuid.UUID(bytes_le=uid))
File “/usr/lib64/python2.7/uuid.py”, line 138, in init
raise ValueError(‘bytes_le is not a 16-char string’)
ValueError: bytes_le is not a 16-char string
The real error occures in the last list,
in
File “/usr/lib64/python2.7/uuid.py” in line 138.
This is called by the privacyIDEA code, which is the line above in the
traceback:
File “/opt/privacyIDEA/…/LDAPIdResolver.py” in line 275
In the method _get_uid. In exactly the line, you identified which is
not reached.
uid = str(uuid.UUID(bytes_le=uid))
So this is the line in privacyIDEA code, where things break. But after
all, it breaks in the python own code uuid. This is why I asked for
versions.
You may also try to add a debug log
log.debug("FBTEST2 {0!r}".format(uid))
log.debug("FBTEST2 {0}".format(len(uid)))
This will output the representation and the length of the string. Which
is indeed 16.
The thing is, the privacyidea code at this point did not change.
So either
- the underlying python code changed or
- your directory changed.
Kind regards
COrneliusAm Montag, den 14.11.2016, 01:26 -0800 schrieb finalbeta@gmail.com:
So the string we are sending to the function is not of the correct
format and acutally is the format we need already.
At this point I’m going to just install a server next to it from
scratch and see what the end result is.
Please read the blog post about getting help
Getting help – privacyID3A.
For professional services and consultancy regarding two factor
authentication please visit
One Time Services - NetKnights - IT-Sicherheit - Zwei-Faktor-Authentisierung - Verschlüsselung
In an enterprise environment you should get a SERVICE LEVEL AGREEMENT
which suites your needs for SECURITY, AVAILABILITY and LIABILITY:
privacyIDEA Support Level
You received this message because you are subscribed to a topic in
the Google Groups “privacyidea” group.
To unsubscribe from this topic, visit https://groups.google.com/d/top
ic/privacyidea/HeeP9qWiiT0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to p
rivacyidea+unsubscribe@googlegroups.com.
To post to this group, send email to privacyidea@googlegroups.com.
Visit this group at https://groups.google.com/group/privacyidea.
To view this discussion on the web visit https://groups.google.com/d/
msgid/privacyidea/02611775-8a46-41ab-81c0-
09c9efbde594%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
–
Cornelius Kölbel
@cornelinux
+49 151 2960 1417
NetKnights GmbH
http://www.netknights.it
Landgraf-Karl-Str. 19, 34131 Kassel, Germany
Tel: +49 561 3166797, Fax: +49 561 3166798
Amtsgericht Kassel, HRB 16405
Geschäftsführer: Cornelius Kölbel
signature.asc (819 Bytes)