Ejemplo n.º 1
0
        /// <summary>
        /// Called when the message has been received,
        /// after it passes through the channel binding elements.
        /// </summary>
        void IMessageWithEvents.OnReceiving()
        {
            var extraData = ((IMessage)this).ExtraData;

            this.ActualPolicies.Clear();
            string[] actualPolicies = this.actualPoliciesString.Split(' ');
            foreach (string policy in actualPolicies)
            {
                if (policy.Length > 0 && policy != AuthenticationPolicies.None)
                {
                    this.ActualPolicies.Add(policy);
                }
            }

            this.AssuranceLevels.Clear();
            AliasManager authLevelAliases = PapeUtilities.FindIncomingAliases(extraData);

            foreach (string authLevelAlias in authLevelAliases.Aliases)
            {
                string authValue;
                if (extraData.TryGetValue(AuthLevelAliasPrefix + authLevelAlias, out authValue))
                {
                    string authLevelType = authLevelAliases.ResolveAlias(authLevelAlias);
                    this.AssuranceLevels[authLevelType] = authValue;
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Called when the message has been received,
        /// after it passes through the channel binding elements.
        /// </summary>
        void IMessageWithEvents.OnReceiving()
        {
            var extraData = ((IMessage)this).ExtraData;

            this.PreferredPolicies.Clear();
            string[] preferredPolicies = this.preferredPoliciesString.Split(' ');
            foreach (string policy in preferredPolicies)
            {
                if (policy.Length > 0)
                {
                    this.PreferredPolicies.Add(policy);
                }
            }

            this.PreferredAuthLevelTypes.Clear();
            AliasManager authLevelAliases = PapeUtilities.FindIncomingAliases(extraData);
            string       preferredAuthLevelAliases;

            if (extraData.TryGetValue(Constants.RequestParameters.PreferredAuthLevelTypes, out preferredAuthLevelAliases))
            {
                foreach (string authLevelAlias in preferredAuthLevelAliases.Split(' '))
                {
                    if (authLevelAlias.Length == 0)
                    {
                        continue;
                    }
                    this.PreferredAuthLevelTypes.Add(authLevelAliases.ResolveAlias(authLevelAlias));
                }
            }
        }