Hi Cornelius,
We don't offer assistance on custom script coding for community users, however, after a quick inspection of the script you linked I have some observations:
- L23 returns `False` (I assume you already populated a property `privacyidea_url` for this script)
- L25 and many others use python 3.x style, I'm not really sure it is properly recognized in custom scripts because Gluu uses Jython as the engine to run scripts and it expects 2.x syntax
- L56 returns `True` but that's not enough because oxAuth cannot determine who the authenticated user is. So you may like to remove that `return` and around L63 do `authenticationService.authenticate(user_name, user_password)`. That will tie the session to the user identified by `user_name`.
I recommend to study the basic script (It is already listed in oxTrust), and then move to a simle 2FA one like twilio_sms.