title: B2C changes my custom subdomain to an onmicrosoft.com subdomain; redirect_uri_mismatch; AADB2C90006
body: <p>My webapp uses B2C for authentication.  Everything works fine when I register my application with a default domain (<em>tenant</em>.onmicrosoft.com) or a simple custom domain (sampledomain.com).</p>
  
  <p>I want to use a subdomain for authentication (<em>login</em>.sampledomain.com) and a separate subdomain for each of my partner orgs (<em>partner1</em>.sampledomain.com, <em>partner2</em>.sampledomain.com) and I've followed the instructions at 
  <a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-app-registration#limitations" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-app-registration#limitations</a> with no success.</p>
  
  <p>When I perform the authentication challenge <code>
  var redirectUrl = "https://login.sampledomain.com/auth-callback";
  HttpContext.GetOwinContext().Authentication.Challenge(
      new AuthenticationProperties { RedirectUri = redirectUrl })</code></p>
  
  <p>The error message shows the <em>wrong</em> value for my subdomain: </p>
  
  <blockquote>
    <p>"<em>AADB2C90006: The redirect URI
    <a href="https://login.sampledomain.onmicrosoft.com/" rel="nofollow noreferrer">https://login.sampledomain.onmicrosoft.com/</a> provided in the request is
    not registered for the client</em>"</p>
  </blockquote>
  
  <p>So the subdomain I've configured 'login.<strong>sampledomain.com</strong>' appears to B2C with the incorrect value 'login.<strong>sampledomain.onmicrosoft.com</strong>'.</p>
  
  <p>Is there some other properties or configuration settings I can provide so B2C doesn't manipulate my subdomain.</p>
  
  <p>Has anyone else got custom subdomain working with B2C, is it possible?  </p>