Connect database table with the local username id and password of the system

how to connect database table with the local username id and password of the system?. When user logs into the machine. opens up the software, he gets only the assets alloted to him. asset information is contained in the database table..anyone has any idea on how to implement this.I'm using mySQLdb with pyqt4.(creating an asset manager, user gets only the assets alloted to him )

You should be able to get the local username using system specific APIs, but getting the password will be tricky: The OS does only keep the hash of it, not the actual value so that nobody can retrieve it.

In Linux you could look into PAM (plugable authentication module): Those are triggered during log in (if the admin has configured them) and actually see the password.