refactor sspi authentication into another function in preparation for basic authentication.

Signed-off-by: abbr <wenfred@gmail.com>