It's generally within FB's terms of service to store Facebook ids, but unless you're a larger company like Yahoo, I don't think you're allowed to do much else other than use the data for your app.