How to audit user authentication into Web Portal?

Our customer has a requirement to audit successful\failed authentications into Web Portal (preferably in database table, not in text log file - we also need a report to display it)
Is it possible to configure OOTB?
If not, then what is the best way to implement it? I can think of the following approach: add invisible control to Web Portal via Web Designer and perform audit when control is initialized. Save 'audit was done' in session to avoid multiple audit entires for the same user session.

Regards,
Ivan