Proxy.InfoPath.SharePointContextToken.GetClaimValue C# (CSharp) Method

GetClaimValue() private static method

private static GetClaimValue ( JsonWebSecurityToken token, string claimType ) : string
token JsonWebSecurityToken
claimType string
return string
        private static string GetClaimValue(JsonWebSecurityToken token, string claimType)
        {
            if (token == null)
            {
                throw new ArgumentNullException("token");
            }

            foreach (JsonWebTokenClaim claim in token.Claims)
            {
                if (StringComparer.Ordinal.Equals(claim.ClaimType, claimType))
                {
                    return claim.Value;
                }
            }

            return null;
        }