title: MVC5 Get logged in user email
body: <p>I have configured my Asp.Net MVC 5 app to use external logins (and I don't intend to use local logins).<br>
  To get the email address of the logged in user, I am doing this  </p>
  
  <pre><code>Membership.GetUser().Email
  </code></pre>
  
  <p>But that is throwing </p>
  
  <pre><code>Host 'xxx' is not allowed to connect to this MySQL server
  </code></pre>
  
  <p>I am able to connect to the database fine. Log in, log out, fetch other data. 
  This works fine too.</p>
  
  <pre><code>User.Identity.GetUserName()
  </code></pre>
  
  <p>The system blows up only when using Membership stuff. </p>
  
  <p>ConnectionString configured in here doesnot exist in the web.config. Wonder how it is working it out!</p>
  
  <pre><code>&lt;membership defaultProvider="MySQLMembershipProvider"&gt;
              &lt;providers&gt;
                  &lt;remove name="MySQLMembershipProvider" /&gt;
                  &lt;add name="MySQLMembershipProvider" type="MySql.Web.Security.MySQLMembershipProvider, MySql.Web, Version=6.9.6.0, Culture=neutral, PublicKeyToken=xxx" connectionStringName="LocalMySqlServer" ... /&gt;
              &lt;/providers&gt;
          &lt;/membership&gt;
  </code></pre>
  
  <p>If I update the connection string to the existing, working EF one, it complains it doesnt support the keyword <em>metadata</em>.</p>
  
  <p>The email address is present in <code>aspnetusers</code> table. I am sure I can fetch it manually by calling the db, but I wonder if Asp.Net already does this for me. </p>