Fixing some parsing issues in authorized_key module

Also adds an integration test for authorized_key for future validation.

Fixes #6700