The 26-year-old Nigerian joined the Hatters from Wycombe, where he had made 114 appearances in two loan moves and one permanent spell with the club.
Onyedinma made 21 appearances for Luton as they won promotion to the top flight through the play-offs last season.