After waiting in line for a long time, I was told I needed an official birth certificate as proof of identity.
Literal
Line [in-に] line-up for a-long-time was-made-to-wait after, identification [as-と] formal birth-certificate [subject-が] necessary [quotative-と] was-told.
A complex multi-clause sentence. 待たされる is the causative-passive of 待つ ('to wait') — 'to be made to wait.' The ~として pattern ('as X, in the capacity of X') marks 身分証明 as the role played by the birth certificate. 言われた is passive of 言う — 'was told.' Classical news/complaint register.