The relevant wording is
(B13) May aliens legally in the United States buy firearms?[Back]
An alien legally in the U.S. may acquire firearms if he has a State of residence. An alien has a State of residence only if he is residing in that State and has resided in a State continuously for at least 90 days prior to the purchase. An alien acquiring firearms from a licensee is required to prove both his identity, by presenting a government-issued photo identification, and his residency with substantiating documentation showing that he has resided in the State continuously for the 90-day period prior to the purchase. Examples of qualifying documentation to prove residency include: utility bills, lease agreements, credit card statements, and pay stubs from the purchaser’s place of employment, if such documents include residential addresses.
See also Item 5, “Sales to Aliens in the United States,” in the General Information section of this publication.
[18 U.S.C. 921, 922(b)(3), (d) and (g), 27 CFR 478.11 and 478.99(a)]
A couple of bizarre parts are is that
1. You have to declare your a permanent resident alien voluntarily but the NICS check doesn't check if you are as far as I know
2. Let say you use as your government ID a drivers licence, which shows you have been resident at a qualifying address since it at least it's been issued (more than 90 days). You still have to show more paper such as an electric bill for 90 days or more.
The real concern can come for such states as California and cities such as New York where there is or is an intention to provide drivers licences, or other "official" ID cards to illegal immigrants.
Once you have one of these then you could, in theory, use this for a face to face, in or out of state, long arm purchase.
This is particularily open to potential abuse as the 4473 form that needs to be filled in only has the SSN as an optional not mandatory requirement.
Any ATF lurkers care to pick holes in this..,......