Hello
First of all, thanks for this wonderful project !
I made a dockerfile (based on python:3.8.7-slim-buster) to deploy PrivacyIDEA 3.5 and found some strange behaviour : I received an error about “utf-8” in api/auth.pi, right after jwt.encode (line 368). Actually, it seem that jwt.encode (in my setup) does not output utf-8…
I looked on the docs, forum and issues and couldn’t find any clue… so I decided to “patch” the problem by removing the “.decode(‘utf8’)”
So, in my patched version:
token = jwt.encode({“username”: loginname,
“realm”: realm,
“nonce”: nonce,
“role”: role,
“authtype”: authtype,
“exp”: datetime.utcnow() + validity,
“rights”: rights},
secret, algorithm=‘HS256’).decode(‘utf8’)
is now:
token = jwt.encode({“username”: loginname,
“realm”: realm,
“nonce”: nonce,
“role”: role,
“authtype”: authtype,
“exp”: datetime.utcnow() + validity,
“rights”: rights},
secret, algorithm=‘HS256’)
I can’t tell if the problem comes from: 1) my server 2) docker 3) the dockerfile 4) jwt.encode or python configuration…
I guess that it is a combination of a bit of everything, as nobody seemed to report it before (and it’s blocking)
Anyway: if someone has the same problem… you’re not alone
I didn’t see any drawback to my “fix” (seem quite a local fix)… except maybe for UTF-8 loginname…
Do you see some ? And do you think that it should be considered as a bug ? A feature ? A configuration problem on my server ?