title: DotNetOpenAuth how to retrieve the email and name from OpenId
body: <p>I'm using DotNetOpenAuth with MVC 3. I'm able to authenticate with OpenId.</p>
  
  <p>So my URL pointing to a controller has a variable appended OpenId=</p>
  
  <p>Here is an example:</p>
  
  <p><a href="https://www.google.com/accounts/o8/id?id=DFtOawDkCUoLb3YxPzmrEI59-JiSZiAeR-NWw-0" rel="nofollow">https://www.google.com/accounts/o8/id?id=DFtOawDkCUoLb3YxPzmrEI59-JiSZiAeR-NWw-0</a> </p>
  
  <p><a href="http://mysite.com/Account/Register?OpenID=" rel="nofollow">http://mysite.com/Account/Register?OpenID=</a>.......</p>
  
  <p>How how can I get the email and name for the OpenId account and showing to the View?</p>
  
  <pre><code>switch (response.Status)
              {
                  case AuthenticationStatus.Authenticated:
                      LogOnModel lm = new LogOnModel();
                      lm.OpenID = response.ClaimedIdentifier;
                      // Check if user exist
                      MembershipUser user = MembershipService.GetUser(lm.OpenID);
                      if (user != null)
                      {
                          lm.UserName = user.UserName;
                          FormsService.SignIn(user.UserName, false);
                      }
  
                      return View("LogOn", lm);
  
                  case AuthenticationStatus.Canceled:
                      ViewBag.Message = "Canceled at provider";
                      return View("LogOn");
                  case AuthenticationStatus.Failed:
                      ViewBag.Message = response.Exception.Message;
                      return View("LogOn");
              }
  </code></pre>