Hello @Victor Seifert - Thanks for reaching out!
The IdentityModelEventSource.ShowPII
property is part of Azure SDK for .NET and the same for Python would be MSAL for Python. And it doesn't seem possible to enable it as this doc states the following about the logging of PII data:
MSAL for Python does not log personal data or organizational data. There is no property to turn personal or organization data logging on or off.
Despite the above, you should still be able to use the standard Python logging for validating the claims included in the JWT tokens.
That aside, in looking at the codes included in your Stackoverflow post, I didn't see any code for authentication - could you share more details on this part? More on MSAL for Python is as follows: https://github.com/AzureAD/microsoft-authentication-library-for-python/wiki
Lastly, if you just need a good starting point, here's the official sample (uses Flask) which might help: Python Azure Function Web API secured by Azure AD
-------------------------------------------------------------------------------
Please consider contributing to MS Q&A by marking 'Accepted Answer' and ‘Upvoting’ as applicable.