Rails engine for authenticating internal applications and private-access products