DotNetOpenAuth Receive Email

I run dotnetopenauth 3.3.0.9283 (nightly build), it works fine and solved my previous problem ( DotNetOpenAuth get email and redirect the problem )

So now I can only get users email from gmail! I tried yahoo and myspace, but I always get "Object reference not set to object instance". I ran the sample that appeared with the assembly, ajaxlogin.aspx and loginProgrammatic.aspx, they both give me the same error message.

this is the only line that I added to the sample (and also set the desired email)

var email = OpenIdAjaxTextBox1.AuthenticationResponse.GetExtension<ClaimsResponse>().Email; 
+4
source share
1 answer

You have too much code on one line.

GetExtension<T>() will return null if the provider does not actually include this extension in the response. Therefore, you should always check that it returns a nonzero value before dereferencing it.

You get a refusal from Yahoo because they do not support the distribution of additional information to your users (yet), with the exception of a small RP white list.

I do not know about MySpace, but I suspect that they simply do not support it.

+7
source

All Articles