Added code for custom auth.