Hook into the authenticate shown at: http://docs.rhomobile.com/rhoconnect/authentication:
def authenticate(username, password, session)
success = false
# ... connect to backend using API and authenticate ...
result = do_custom_authentication(username,password)
if result.code == 200
# save the data for later use in the source adapter
success = true
Then from your query source adapter you can use that stored user.
If you mean from source adapter-less scenario (plugin only), that really depends on your backend app. You could presumably add appropriate calls from the authenticate method above to your backend .NET app to inform them of logged in users. But there are presumably more than one logged in user. How your backend app services all of those users really depends on how you have built your app. If it is stateful you presumably need to set up states for each of your authenticated users. For example, your plugin may need to make multiple calls back to RhoConnect for each logged in user, servicing some kind of set of users that is set up by those authenticate calls.