NEW YORK/SAN FRANCISCO (Reuters) - Facebook Inc is buying a software firm that specializes in authenticating government-issued identification cards, the two companies said on Tuesday, a step that may help the social media company learn more about the people who buy ads on its network.