문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top