The NIP42 auth is done automatically by default. The problem is that relay ask for authentication after you send an EVENT or a REQ.
After successful authenticaltion, the REQ is automatically resent but not the event (yet). I wrote a possible workaround here: https://github.com/rust-nostr/nostr/issues/509