Read username from JID inside module

I’m trying to create a module which ties certain rooms to certain users

but I need a way to find out which user owns that JID
the user of interest will be the one that types his username and password to start the meeting

I’m using the simple authentication from prosody