It was an EA (Executive Agreement) so it really wasn't 'illegal', just scummy as hell.
Barak Obama entered into negotiations on behalf of the United States and made concessions and agreements on behalf of the United States, Constitutional powers / authorities he did not have.
I know you snowflakes bend over so far backwards to try to protect President Obama from the crimes he committed, to the point where you can actually stick your head up your own ass, but no matter how you try to explain it or what YOU want to call it, Obama violated the Constitution by agreeing to his OWN PERSONAL Treaty with Iran.
The Constitution does not give the President the power / authority to make binding agreements as was done by Barry with Iran through 'Executive Order'. Try learning about the Separation of Powers Act, something liberals no longer teach in public schools for a reason.
After he signed it he ran straight to the UN to get his illegal treaty ratified by the International body, by-passing Congress again to do so. As such, the illegal treaty was not worth the paper it was written on.
President Trump appropriately voided / wiped away that illegal treaty along with Obama's illegal Constitutionally violating personal 'DACA' EDICT.