本文整理汇总了C#中IAuthenticationResponse.IsNull方法的典型用法代码示例。如果您正苦于以下问题:C# IAuthenticationResponse.IsNull方法的具体用法?C# IAuthenticationResponse.IsNull怎么用?C# IAuthenticationResponse.IsNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IAuthenticationResponse
的用法示例。
在下文中一共展示了IAuthenticationResponse.IsNull方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryGetOpenIdResponse
public override bool TryGetOpenIdResponse(out IAuthenticationResponse openIdResponse)
{
openIdResponse = openIdRelyingParty.GetResponse();
if (openIdResponse.IsNull())
{
return false;
}
return true;
}
示例2: ParseOpenIdResponse
public override OpenIdData ParseOpenIdResponse(IAuthenticationResponse openIdResponse)
{
if (openIdResponse.IsNull())
{
throw new ArgumentException("Invalid open id response");
}
//Let us check the response
switch (openIdResponse.Status)
{
case AuthenticationStatus.Authenticated:
var openId = openIdResponse.ClaimedIdentifier;
var friendlyName = openIdResponse.FriendlyIdentifierForDisplay;
return new OpenIdData() {FriendlyName = friendlyName, OpenId = openId};
break;
default:
throw new ArgumentException("Invalid open id");
}
}