Fix authentication with credentials containing characters to be encoded.