Fixed #22362 -- Improved AuthenticationMiddleware assertion message.

Thanks Keryn Knight.