Use forms authentication mode, and the login form can determine the user and the preferred authentication method for this user. If the user can be authenticated by Windows, you do not need to submit a login form, just set the user as authenticated and redirected accordingly.
source share