A father-of-three was caught carrying out a bogus charity collection in a supermarket car park with a clearly doctored ID card.
Shane Cawley (23) had a wooden table set up for the collection when gardai caught him, a court heard.
Judge David McHugh said Cawley had taken advantage of the public in an "appalling" way.
He adjourned the case for the production of a probation report.
Cawley, with an address at Palmerstown Lodge, Kennelsfort Road Lower, Palmerstown, pleaded guilty to acting as a collector and holding an un- authorised collection.
The incident happened at the Lidl car park on the Nangor Road, Clondalkin, last August 26.
Blanchardstown District Court heard gardai encountered the accused at 12.40pm on the afternoon in question.
He was holding a collection at a wooden table, with a plastic lunch box containing money.
Gardai asked him what he was collecting for and he told them it was the Irish Lung Foundation.
Asked if he had a licence, he produced an Irish Lung Foundation ID card, but it was "clear that it had been altered and doctored and was not valid", a garda said.
Cawley had no previous convictions of any kind.
The accused had been unemployed and homeless and staying in B&Bs. He had three children, three-month-old twins and a two-year-old, his lawyer said.
Cawley, who had not attended secondary school, had no drink or drug problem.
"From a moral, never mind a legal perspective, it is absolutely appalling that someone would take advantage of the public in the name of a charity," Judge McHugh said.
He ordered a probation rep-ort and adjourned the case to a date in November.
The judge granted free legal aid and remanded the defendant on continuing bail.
Cawley did not address the court during the brief hearing.
The charges against him were under the Street and House to House Collections Act.