The president has threatened military action if Iran does not agree to a far-reaching deal on its nuclear program.