Fixed authenticate

Fixed authenticate with server environment