We are creating an security token service using IdentityServer4. Due to audit requirements, we would like to log every succeeded (and failed) login attempt, together with information about the issued token, in particular: which claims the token includes.
The most obvious part seems to turn on (some of) the event types provided in IdentityServer and create a custom event sink where login success and failure can be handled (e.g. logged to a database).
We have created such a sink, but the event passed into the PersistAsync method does only contain information about the user trying to log in and nothing about the issued token. I also find various issued (here, here and here) that mentions the security concerns around supporting token logging, customization of token logging etc., all making me believe that this might not be as straight forward as we hope.
So the question is: Where, if even possible, would be the correct/best place to hook into IdentityServer i order to achieve audit logging of the issued tokens?