コード例 #1
0
        /// <summary>
        /// Determines if authentication is scoped and uses package verify claim.
        /// </summary>
        public static bool HasPackageVerifyScopeClaim(this IIdentity self)
        {
            var scopeClaim = self.GetScopeClaim();

            return(!ScopeEvaluator.IsEmptyScopeClaim(scopeClaim) &&
                   ScopeEvaluator.ScopeClaimsAllowsActionForSubject(scopeClaim, subject: null,
                                                                    requestedActions: new [] { NuGetScopes.PackageVerify }));
        }
コード例 #2
0
        public static bool IsScopedAuthentication(this IIdentity self)
        {
            var scopeClaim = self.GetScopeClaim();

            return(!ScopeEvaluator.IsEmptyScopeClaim(scopeClaim));
        }