Which canon and traditions does the Flower Sermon text belong to? I've heard of a Buddhist story in which the Buddha just holds up a flower and one monk in the audience understands then becomes instantly enlightened. I believe it is a foundational text for Zen Buddhism. Where does this text originate from? What canon or collection of texts is it from? When was it wrote and which tradition(s) does it derive from?

Generally I would just like to know a bit of background to the history, authoring and authority of the text. I have only ever hear to it referred to in secondary sources and never giving a primary reference.
Here is some information about it:


  The origin of the Zen school is traditionally traced to Mahakassapa,
  who was said to have received a direct transmission outside the
  scriptures. This transmission is illustrated with the evocative story
  of the Buddha holding a flower silently before the assembled Sangha:
  only Mahakassapa understood, and smiled. The story is gains special
  resonance since Mahakassapa is renowned as a curmudgeonly old monk –
  although his authentic verses in the Theragatha do indeed show a
  delightful love of nature.
  
  Despite the fame and importance of the story, it is not attested in
  any Indic scripture, and is a Chinese Chan invention. It’s first
  appearance is apparently in the compilation of koans, the 無門關
  (Wúménguān, often rendered in English as The Gateless Gate), compiled
  by the Chinese Zen master Wumen Hui-k’ai (無門慧開) and first published in
  1228. The development of the notion of lineages is discussed by Dumoulin.
  -The Date of the Flower Sermon, Sujato Bhikkhu


The text is found, as mentioned above, in "The Gateless Gate" under the heading "Buddha Twirls a Flower".