0

For some reason, the following code does not return anything:

string alias = response.FriendlyIdentifierForDisplay;
var sreg = response.GetExtension<ClaimsResponse>();
if (sreg != null && sreg.MailAddress != null) 
{
    alias = sreg.MailAddress.User;
}
if (sreg != null && !string.IsNullOrEmpty(sreg.Email))
{
    alias = sreg.Email;
}
if (sreg != null && !string.IsNullOrEmpty(sreg.FullName)) 
{
    alias = sreg.FullName;
}

I was hoping I can get the Email from Yahoo or Google, but sreg just return null whichever provider I have chosen.

I saw some of other posts that this code should return an e-mail at least, but for me, it does not, please assist.

Thanks alot

Dylan Corriveau
  • 2,565
  • 4
  • 27
  • 36
PlayKid
  • 831
  • 2
  • 10
  • 21
  • possible duplicate of [OpenID: Trying to Get Email Address from Google OP](http://stackoverflow.com/questions/1301200/openid-trying-to-get-email-address-from-google-op) – Andrew Arnott Jun 16 '10 at 02:53

1 Answers1

0

You must ensure that what you add the email address to ClaimsRequest with the required flag set to true.

You must also ensure that you've correctly activated the AXFetchAsSregTransform.

Andrew Arnott
  • 74,820
  • 24
  • 127
  • 163