# SimpleAuthenticator and Automatic Reconnect

**URL:** <https://community.hivemq.com/t/simpleauthenticator-and-automatic-reconnect/347>\
**Category:** HiveMQ Community Edition\
**Created:** [September 28, 2020, 5:36pm UTC](https://community.hivemq.com/t/simpleauthenticator-and-automatic-reconnect/347 "2020-09-28T17:36:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayp](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@jayp](https://community.hivemq.com/u/jayp)\
**Post date:** [September 28, 2020, 5:36pm UTC](https://community.hivemq.com/t/simpleauthenticator-and-automatic-reconnect/347/1 "2020-09-28T17:36:34Z")

</div>

I’ve written a SimpleAuthenticator plugin and am seeing some weird behavior, and was hoping I’m overlooking something. I’m able to authenticate a client no problem, but if I bring down the hivemq server and restart it, the client does indeed reconnect and the SimpleAuthenticator gets called a second time, however it appears that getConnectPacket().getUsername() is empty. Does the client not send authentication information on reconnects?

---

<div class="post-metadata">

**Author:** ![jayp](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@jayp](https://community.hivemq.com/u/jayp)\
**Post date:** [September 28, 2020, 5:54pm UTC](https://community.hivemq.com/t/simpleauthenticator-and-automatic-reconnect/347/2 "2020-09-28T17:54:20Z")

</div>

Figured it out. Simple Auth needs to be applied to the Mqtt5ClientBuilder.
