title: Does an OpenID realm have to be the base URL of the web site?
body: <p>As a continuation of <a href="https://stackoverflow.com/q/12517083/1324019">this question</a>, there's an issue I'm having with dotnetopenauth.</p>
  
  <p>Basically, I'm wondering if the realm specified in the RP has to be the actual base URL of the application? That is, (<code>http://localhost:1903</code>)? Given the existing architecture in place it is difficult to remove the redirect - I tried setting the realm to the base OpenId controller (<code>http://localhost:1903/OpenId</code>) and testing manually did generate the XRDS document. However, the application seems to freeze, and the EP log reveals the following error:</p>
  
  <p><code>2012-10-10 15:17:46,000 (GMT-4) [24] ERROR DotNetOpenAuth.OpenId - Attribute Exchange extension did not provide any aliases in the if_available or required lists.</code></p>
  
  <p>Code:</p>
  
  <p>Relying Party:</p>
  
  <pre><code>public ActionResult Authenticate(string RuserName = "")
  {
  UriBuilder returnToBuilder = new UriBuilder(Request.Url);
  returnToBuilder.Path = "/OpenId/Authenticate";
  returnToBuilder.Query = null;
  returnToBuilder.Fragment = null;
  
  Uri returnTo = returnToBuilder.Uri;
  returnToBuilder.Path = "/";
  Realm realm = returnToBuilder.Uri;
  
  var response = openid.GetResponse();
  
  if (response == null) {
      if (Request.QueryString["ReturnUrl"] != null &amp;&amp; User.Identity.IsAuthenticated) {
  
      } else {
  
      string strIdentifier = "http://localhost:3314/User/Identity/" + RuserName;
      var request = openid.CreateRequest(
          strIdentifier,
          realm,
          returnTo);
  
      var fetchRequest = new FetchRequest();
      request.AddExtension(fetchRequest);
      request.RedirectToProvider();
      }
  } else {
      switch (response.Status) {
          case AuthenticationStatus.Canceled:
              break;
          case AuthenticationStatus.Failed:
              break;
          case AuthenticationStatus.Authenticated:
              //log the user in
              break;
      }
  }
  
  return new EmptyResult();
  </code></pre>
  
  <p>}</p>
  
  <p>Provider: </p>
  
  <pre><code>public ActionResult Index()
  {
      IRequest request = OpenIdProvider.GetRequest();
  
      if (request != null) {
          if (request.IsResponseReady) {
              return OpenIdProvider.PrepareResponse(request).AsActionResult();
          }
  
          ProviderEndpoint.PendingRequest = (IHostProcessedRequest)request;
          return this.ProcessAuthRequest();
      } else {
          //user stumbled on openid endpoint - 404 maybe?
          return new EmptyResult();
      }
   }
  
  public ActionResult ProcessAuthRequest()
      {
          if (ProviderEndpoint.PendingRequest == null) {
              //there is no pending request
              return new EmptyResult();
          }
  
          ActionResult response;
          if (this.AutoRespondIfPossible(out response)) {
              return response;
          }
  
          if (ProviderEndpoint.PendingRequest.Immediate) {
              return this.SendAssertion();
          }
  
          return new EmptyResult();
      }
  </code></pre>