title: Error while Authenticating sharepoint site with Azure AD users using Azure Access Control Namespace
body: <p>I have a Sharepoint site running on Azure virtual Machine.
  Now i want to authenticate my sharepoint site with Azure AD users.</p>
  
  <p>For this i have followed below link, but getting error after login.</p>
  
  <p><a href="https://technet.microsoft.com/en-us/library/dn635311.aspx" rel="nofollow noreferrer">Using Microsoft Azure Active Directory for SharePoint 2013 authentication</a></p>
  
  <p>I have implemented as given on reference link, but still facing error.
  When i access my url from browser, it will ask me through which you want to logon.</p>
  
  <p><img src="https://i.stack.imgur.com/XTu8p.png" alt="enter image description here"></p>
  
  <p>Then on selection of ACS Provider, it will redirect me to office365 login.
  After i submit my credentials, it will redirect me to </p>
  
  <p><a href="https://testvm.cloudapp.net/_trust/" rel="nofollow noreferrer">https://testvm.cloudapp.net/_trust/</a></p>
  
  <p>and got error. So i checked in sharepoint log and found below error.</p>
  
  <p>Cannot find site lookup info for request Uri urn:sharepoint:spvms.</p>
  
  <p>SPAudienceValidator: Audience uri 'urn:sharepoint:spvms is not valid for the context.</p>
  
  <p>Getting Error Message for Exception Microsoft.IdentityModel.Tokens.FailedAuthenticationException: The Audience URI could not be validated.    </p>
  
  <p>SPSaml11SecurityTokenHandler: Audience validation failed for request '<a href="https://testvm.cloudapp.net/_trust/" rel="nofollow noreferrer">https://testvm.cloudapp.net/_trust/</a>' with the following audience URIs: 'urn:sharepoint:spvms', .</p>
  
  <p>Application error when access /_trust/, Error=The Audience URI could not be validated.<br>
   at Microsoft.SharePoint.IdentityModel.SPSaml11SecurityTokenHandler.ValidateConditions(SamlConditions conditions, Boolean enforceAudienceRestriction)<br>
   at Microsoft.IdentityModel.Tokens.Saml11.Saml11SecurityTokenHandler.ValidateToken(SecurityToken token)<br>
   at Microsoft.IdentityModel.Tokens.SecurityTokenHandlerCollection.ValidateToken(SecurityToken token)<br>
   at Microsoft.IdentityModel.Web.TokenReceiver.AuthenticateToken(SecurityToken token, Boolean ensureBearerToken, String endpointUri)<br>
   at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.SignInWithResponseMessage(HttpRequest request)<br>
   at Microsoft.IdentityModel.Web.WSFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs args)<br>
   at Microsoft.SharePoint.IdentityModel.SPFederationAuthenticationModule.OnAuthenticateRequest(Object sender, EventArgs eventArgs)<br>
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()<br>
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)</p>