Tidy up authentication section to correct problems reported in FB 41202.