SAN FRANCISCO — A magistrate judge in San Francisco has tossed out a lawsuit by Facebook Inc. against the IRS, ruling the social media giant does not have a right to challenge its massive tax bill through an internal IRS appeals process.

The company sued the IRS last fall as part of an ongoing dispute with the tax authority over the value of assets Facebook transferred in 2010 to its Irish holding company. The IRS said Facebook undervalued those assets by some $7 billion, which Facebook contests.