The League of Ireland champions travel to Poland in the Champions League while Derry City must make the short trip to Wales in the Europa League
The Saints, who qualified for the competition after winning the Premier Division in 2013, were unseeded for the draw, which took place on Monday June 23, and begin their European odyssey the Polish side in July.
Last season's Premier Division runners-up Dundalk, meanwhile, will face AS Jeunesse Esch from Luxembourg in the Uefa Europa League first qualifying round.
Derry City, who were seeded for the Europa League first qualifying round, have been drawn against Welsh outfit Aberystwyth Town, while Sligo Rovers will take on FK Banga.
Elsewhere, Cliftonville have been paired with Hungarian side Debreceni VSC in the Champions League second qualifying round.
Linfield will play B36 Torshavn in the Europa League first qualifing round, while Crusaders face FK Ekranas. Glenavon take on Icelandic side FH.
Uefa Champions League first qualifying round games are played on 1/2 and 8/9 July with the second qualifying round taking place on 15/16 and 22/23 July.
The Uefa Europa League first qualifying round is scheduled to take place on 3 and 10 July, with the second qualifying round on 17 and 24 July. Dates to be confirmed.
Champions League second qualifying round
Cliftonville v Debreceni VSC
Legia Warsaw v St Patrick's Athletic
Europa League first qualifying round
Derry City v Aberystwyth Town
FK Banga v Sligo Rovers
AS Jeunesse Esch v Dundalk
FH v Glenavon
B36 v Linfield
Crusadersv FK Ekranas