added support for non-plain authentication