update: it appears Norway did the spying on its own citizens that is then shared with the USA. That would appear to satisfy the legal requirements in this example. I still question the legality of many actions by the USA - it just seems likely violations of laws of other countries are frequent. We can't violate other's laws and they expect them to obey the laws we want them to. NSA logged 33m calls in Nato ally Norway
Torstein Olsen, head of Norway's telecoms regulator, said that it was illegal for anyone apart from telecommunications companies to collect such data. "If Dagbladet's information is correct that 33 million mobile phone calls in Norway were registered by someone other than the telecommunication companies, that would be a crime under Norwegian law," he said.Also the USA government was I believe successful in preventing USA citizens and companies from using encryption that was safe while knowingly encouraging other governments to spy using the advantage of poor encryption. Given the continuing stream of evidence on bad practices the USA government tried to hide from public condemnation the USA government has effectively given cart blanche to every sovereign state to spy electronically as much as they want to.
So it seems the USA government has sold out the ability of its citizens to protect themselves from not just spying from its own government but all other governments spying on all personal, business and political activities in the USA (based on the actions the USA has taken they certainly can't expect other governments to be less intrusive than the USA has been to their citizens and political leaders - and at this point we would certainly have to assume businesses also).
The repeated, crushing blows to the rule of law, respect for the right of people and honorable behavior by the USA the last 15 years is extremely disheartening. The USA it seems to me fell far short of the standards it should have set the last 50 years but at least the USA seemed to have some credibility when attempting to encourage others to behave in accordance with the rule of law which would make the world a better place. Now I can't imagine what country is more consistently and aggressively flaunting their disrespect for the rule of law. The USA currently seems to have only one justification for their actions: might makes right. We can do whatever we want because you can't stop us militarily and we can crush you economically if you don't do whatever we tell you to do.
Choosing to follow some laws and then expecting other countries to follow all the laws you care about is not sensible behavior.
I seriously hope we can recover from the disastrous behavior of our government the last 15 years. We recovered from McCarthyism and Watergate but this behavior seems much worse to me (and those were very bad).
It has gotten so some of the most far fetched "conspiracy theory" claims are superseded by what the USA government actually does. That is a very bad state of affairs.
Related: I Can Spy on You, But You Can't Spy on Me (isn't a sensible expectation) - Watching the Watchmen - Librarians Standing Up to the Madness - Freedom Increasingly at Risk