Ex-President Barack Obama gave a secret talk in Boston yesterday at the MIT Sloan Sports Analytics Conference, where organizers threatened to eject and ban credentialed journalists for simply doing their jobs — prohibiting them from tweeting or reporting on the event, both during and after.

“Everyone involved in this blanket coverage ban should be embarrassed,” said Ken Paulson, the president of the First Amendment Center at the Newseum in Washington, D.C. “I’m sure President Obama has his pick of lucrative speaking gigs. Why pick one that’s the antithesis of transparency?”

Reporters were granted media credentials weeks ago, only to be slapped with the journalistic equivalent of a gag order just 24 hours before the conference. The Herald declined a credential after being informed it could purchase one for a “discounted rate” of nearly $400.

“During President Obama’s panel the following will not be permitted, without exception: photography, video recording, streaming, and social media posting — including the use of Twitter, Facebook, Instagram, Snapchat, and other platforms,” read the warning from MIT conference organizers. “Following the panel, the sharing or reporting of its contents on public platforms, including news outlets and social media, will not be permitted. This policy applies to all attendees, credentialed media included.”

The MIT conference also threatened that “those who fail to adhere to this policy will be subject to removal from the conference and denied tickets to future SSAC conferences.”

Paulson said reporters should be the ones giving the ultimatum to conference organizers over their “oppressive restrictions” on journalism.

“Why would you agree to play the game, encouraging future manipulation?” Paulson asked. “The strength of a free press depends on true independence. A private organization can certainly set its own rules, but journalists need to apply their own, including not attending events they can’t share with their readers and viewers.”

MIT Sloan Sports Analytics Conference spokesmen declined to comment last night.

Officials closely monitored attendees and quickly scolded anyone who even reached for their phones, participants told the Herald.

“I saw someone texting and they got yelled at in two seconds,” said Adam Sills of Hoboken, N.J.

Obama, whose administration was hailed as the “most transparent administration in history,” spoke mostly about basketball and shied away from politics or President Trump.

“He thinks people, based off of how they play basketball, you can get a good feel for someone’s personality,” said Jeff Eldersveld of Columbus, Ohio. “He was giving an example of how he used to play, which was very selfish. And he appreciated the coach calling him out for it and benching him.”

Sills said Obama also cracked a few jokes about being a “fact-based, logical person.”