Search code examples
asp.netopenid

retrieve email id information from openid response


I am storing response from openid provider using

NameValueCollection query = HttpContext.Current.Request.QueryString;  

I am sending request for emailid as

"&openid.ax.type.email=" + 
    HttpUtility.UrlEncode("http://schema.openid.net/contact/email")) 

but receiving emailid in openid.ext1.value.email in some case and openid.ax.value.email in others.


Solution

  • There is a similar question, which I answered.

    You must check everything starting with "openid.ns." and search for the correct namespace.
    You can't depend on it being ax, ext1, or anything else.

    Additionally, you can't depend on the name being "email", you still have to check what it's named by checking namespaces in openid.ax.type. (where ax can be any alias, see above)