Deal with all the possible return codes from the Authenticate resource.
Added more tests for the Authenticate resource.