Implement SQL-based authentication realm