CXF-5118 - Factoring out credential handling