Reference

Genesis 37; Genesis 39; Psalm 105:16-22; Ephesians 2:8-10; Acts 17:26-27

God is the author of both the rising & falling of Joseph's life to show His glory by saving many people. All attempts to stop it are actually used by God to accomplish it. Years later God would author His own humiliation to save many people from judgement