Autodiscover default to SSO

I’m trying to configure our email domain so that em Client can autodiscover the settings.
I’ve created an SRV record pointing to a domain which serves an autodiscover.xml file generated via CGI script to be appropriate for the user.

em Client picks up the settings correctly (IMAP, server name, ports), but never prompts the user for a password.
When you access the automatically configured account the authentication is set to ‘Use integrated Windows authentication (SSO)’ instead of username and password.
If you manually change this to username and password the dialog displays the correct username picked up from the autodiscover.xml.

Is there a way to tell em Client to prompt the user for a password as part of the autodiscover process?

This is the autodisover.xml that gets served (the $variable bits get replaced with appropriate values based on the email address provided by em Client in the autodiscover process):

<?xml version="1.0" encoding="utf-8" standalone="no" ?>
<Autodiscover xmlns="http://schemas.microsoft.com/exchange/autodiscover/responseschema/2006">
<Response xmlns="http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a">
  <Culture>en:us</Culture>
  <User>
    <DisplayName>$name</DisplayName>
    <EMailAddress>$email_address</EMailAddress>
  </User>
  <Account>
    <AccountType>email</AccountType>
    <Action>settings</Action>
    <Protocol>
      <Type>IMAP</Type>
      <Server>$email_server</Server>
      <Port>993</Port>
      <SSL>on</SSL>
      <SPA>on</SPA>
      <DomainRequired>off</DomainRequired>
      <LoginName>$userid</LoginName>
      <AuthRequired>on</AuthRequired>
    </Protocol>
    <Protocol>
      <Type>SMTP</Type>
      <Server>$email_server</Server>
      <Encryption>TLS</Encryption>
      <Port>587</Port>
      <SPA>on</SPA>
      <DomainRequired>off</DomainRequired>
      <LoginName>$userid</LoginName>
      <AuthRequired>on</AuthRequired>
    </Protocol>
  </Account>
</Response>
</Autodiscover>

i know this is a old post, but maybe my answer is helping others:

What we figured out that eM Client always choose SSO with autodiscover when:

  • the client is part of a Windows Active Directory Domain
  • autodiscover doesnt offer basic auth

To enable basic Auth add this lines to your .htaccess:

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

Then extend your autodiscover.php with this lines at the beginning just to show a pseudo user/password dialog:

if (!isset($_SERVER['PHP_AUTH_USER'])) {
    header('WWW-Authenticate: Basic realm="My Realm"');
    header('HTTP/1.0 401 Unauthorized');
} else {
}

After that, eM Client will ask you for your Password before setting up the Account automatically.

1 Like