bs_auth function

Authenticate a user