Lock.js with Connection button

Hello,

We do a customization with lock.js.
We do have a external SAML connection, where the username is a username not an email address.
When not doing the customization via lock.js, we can select “Connection button” and everything works. This option is not possible when doing lock.js.
How can we implement our requirements with lock.js and “Connection button”?

regards,
Moritz