You will need to do a 3-step approach:
- Bind to the directory with a known user
- Search the directory for the entry with sAMAccountName "name.surname" and retrieve the DN for that entry
- Bind to the directory again now with the just retrieved DN and the user-provided Password.
Have a look for an example at https://gist.github.com/heiglandreas/5689592
When you are binding to an ActiveDirectory you might also be able to use the sAMAccountName directly when prefixed with the ADs domain like this:
Hope that helps