Sold into slavery by his jealous brothers, he rose to become vizier, the second most powerful man in Egypt next to Pharaoh, where his presence and office caused Israel to leave Canaan and settle in Egypt. The composition of the story can be dated to the period between the 7th century BCE and the third quarter of the 5th century BCE, which is roughly the period to which scholars date the Book of Genesis.
In Rabbinic tradition Joseph is considered ancestor of another Messiah called "Mashiach ben Yosef". He will wage war against the evil forces alongside Mashiach ben David and die in combat with the enemies of God and Israel.(Wikipedia.com)