title: Azure SQL Active Directory Integrated Auth, Federated Domains
body: <p>I Have been unable to connect to Azure SQL Server using Active Directory Integrated Auth. When attempting to authenticate I get the error below. </p>
  
  <p>Any Ideas on how to further identify this issue would be appriciated. </p>
  
  <h2>Cheers</h2>
  
  <p>Cannot connect to XXXXXXX.database.windows.net.</p>
  
  <p>===================================</p>
  
  <p>Failed to authenticate the user NT Authority\Anonymous Logon in Active Directory (Authentication=ActiveDirectoryIntegrated).
  Error code 0xCAA9002C; state 10
  Failed to parse XML blob.
  Reason: XML document must have a top level element.
  Line: 0, Position: 0
  Text: (null) (.Net SqlClient Data Provider)</p>
  
  <hr>
  
  <p>For help, click: <a href="http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;EvtSrc=MSSQLServer&amp;EvtID=0&amp;LinkId=20476" rel="nofollow">http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&amp;EvtSrc=MSSQLServer&amp;EvtID=0&amp;LinkId=20476</a></p>
  
  <hr>
  
  <p>Server Name: XXXXXXX.database.windows.net
  Error Number: 0
  Severity: 11
  State: 0
  Procedure: ADALGetAccessToken</p>
  
  <hr>
  
  <p>Program Location:</p>
  
  <pre><code>   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, DbConnectionPool pool, String accessToken, Boolean applyTransientFaultHandling)
     at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
     at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions)
     at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&amp; connection)
     at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
     at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
     at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)
     at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
     at System.Data.SqlClient.SqlConnection.Open()
     at Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValidateConnection(UIConnectionInfo ci, IServerType server)
     at Microsoft.SqlServer.Management.UI.ConnectionDlg.Connector.ConnectionThreadUser()
  </code></pre>