Exodus 1:19-20 ASV

These midwives lied to Pharaoh to save the Hebrew baby boys and God blessed them. When is lying ok? Back in Genesis, Abraham lied to Pharaoh because he thought it would save his wife and his own life, and God rebuked him.