In John Rippon's A Selection of Hymns (1787, plus numerous subsequent editions), "How Firm a Foundation" (no. 128) is attributed simply to "K—". Two other hymns in the collection bear the same mark, "In songs of sublime adoration and praise," and "The Bible is justly esteemed." The author of the hymn has never been definitively identified, but the most common candidates are listed below.
I. Robert Keen(e)
The most likely possibility is Robert Keene, who served as precentor at Rippon's church. The evidence for connecting K with Keene comes (1) from his close acquaintance with Rippon, (2) Rippon's tune book, and (3) the testimony (of sorts) of Thomas Walker.
After Rippon started publishing a tune book, A Selection of Psalm and Hymn Tunes (1792), to go with his hymnal, both books were cross-referenced against each other; the tunes suggested for "How Firm a Foundation" were GEARD (no. 156) and BROUGHTON (no. 172). Both GEARD and BROUGHTON first appeared in Rippon's tune book and were probably written for it. BROUGHTON is by T. [Thomas] Walker., and GEARD is by R. [Robert] Keene, thus the association with "K.", but the connection is speculative at best.
Julian, in his article on "How Firm" in the Dictionary of Hymnology, notes that Walker later assisted Alexander Fletcher with his A Collection of Hymns (1822), and in that collection the text is attributed to Keen.
II. George Keith
In Josiah Miller's Singers and Songs of the Church (1869), "How Firm" is attributed to George Keith. According to Julian, the motivation behind this attribution was Daniel Sedgwick—-Miller credits him in the preface with having contributed special hymnological knowledge--yet Julian notes that Sedgwick garnered his information from "an old woman whom Sedgwick met in an almshouse." Keith was a publisher in London, and was the son-in-law of Dr. Gill, Rippon's distinguished predecessor at Carter Lane.
III. Thomas Kirkham
In 19th century editions of Rippon's Selection, the hymn was attributed to "Kirkham." Thomas Kirkham published A Collection of Hymns in 1788, yet "How Firm" was not included. His connection to Rippon is unclear.
Still other collections offer a different possiblity: a Kennedy or Kennady. This attribution appears as early as 1827 in Nettleton's Village Hymns. In Spurgeon's Our Own Hymn Book (1866), he offers "Kirkham or Kennedy, 1787." This person has yet to be identified.
with contributions from Eric Stedfeld, Peter Irvine, and Peter Rehwaldt
See also "How Firm a Foundation".