Wrap authentication info in data type
Fix socket setup