I don't see this point made, so I'll add it.
John Kerry is and has been a lobbyist since his retirement from secretary of state. There's no legal reason why he can't lobby for policies that he helped create while in office.
The Iran nuclear deal is policy, at least it is until Trump scraps it, by executive order or other means. Trump has spoken against the deal and it may be officially ended now. It was policy when Kerry met with Iranian leaders. Having a meeting about existing policy (not about making new policy) doesn't violate the Logan act.
Source.
Relevant quotes
But according to University of Texas School of Law professor Steve
Vladeck, who explained the history of the Logan Act to The Atlantic in
early 2017, the Logan Act wouldn’t apply to anything Kerry is doing,
in part because the Iran nuclear deal is still official government
policy
and
“The act only applies to conduct that is designed to ‘defeat the
measures of the United States’ or influence the conduct of foreign
governments,” Vladeck said. “If all Kerry is doing is working to keep
in place something that’s still technically a ‘measure of the United
States,’ I don’t see how the statute would apply even if someone was
crazy enough to try it."
Despite that, I'm quite sure that legal arguments can be found to the contrary, but since this specific point wasn't made, I wanted to add it. A legal scholar, University of Texas School of Law professor Steve Vladeck, says Kerry did not violate the act and he explains why. That explanation doesn't apply to Michael Flynn.
Now if you want to argue that Kerry shouldn't have done this in secret (fine) - though I'm not sure what a "meeting in secret" actually means. That, quite literally, is vague terminology that sounds good. If they truly wanted to have the meeting in secret, do it in secure video conference, don't fly to Iran. It wasn't a "secret meeting" it was a meeting and anyone who disagrees, please provide a legal definition of a secret meeting and show me how this fits that criteria.
If you want to say that what Kerry did was dumb and that it backfired, that's something I lean towards agreeing with. I'm not sure what Kerry accomplished with meeting with European and Iranian leaders that wasn't made worse by Trump calling Kerry out. But Kerry didn't have a meeting about making new policy and that puts him on very different ground than Flynn, who had meetings about precisely that.
Trump had been publicly discussing ending the agreement, so one could argue that Kerry may have broken the spirit of the law, (or you could argue that he was simply acting as a lobbyist and 100% legally because the meeting was regarding existing policy), but even if you take the argument that he deliberately went against what Trump was proposing as a likely outcome, Kerry didn't violate the Logan act because it was still policy at the time.