Ejemplo n.º 1
0
        private void BuildAuthorizationProviders()
        {
            AuthorizationProviderCollectionNode authorizationProviderCollectionNode = (AuthorizationProviderCollectionNode)hierarchy.FindNodeByType(typeof(AuthorizationProviderCollectionNode));

            foreach (AuthorizationProviderNode authorizationProviderNode in authorizationProviderCollectionNode.Nodes)
            {
                securityConfiguration.AuthorizationProviders.Add(authorizationProviderNode.AuthorizationProviderData);
            }
        }
Ejemplo n.º 2
0
        private void ResolveDefaultAuthorizationNode()
        {
            if ((securitySettings.DefaultAuthorizationProviderName == null) || (securitySettings.DefaultAuthorizationProviderName.Length == 0))
            {
                return;
            }

            AuthorizationProviderCollectionNode nodes = this.Hierarchy.FindNodeByType(this, typeof(AuthorizationProviderCollectionNode)) as AuthorizationProviderCollectionNode;

            Debug.Assert(nodes != null, "Could not find the AuthorizationProviderCollectionNode");
            DefaultAuthorizationInstance = Hierarchy.FindNodeByName(nodes, securitySettings.DefaultAuthorizationProviderName) as AuthorizationProviderNode;
        }
Ejemplo n.º 3
0
        private void GetAuthorizationProviders()
        {
            AuthorizationProviderCollectionNode authorizationProviders = Hierarchy.FindNodeByType(typeof(AuthorizationProviderCollectionNode)) as AuthorizationProviderCollectionNode;

            if (authorizationProviders == null)
            {
                return;
            }
            if (Object.ReferenceEquals(securitySettings.AuthorizationProviders, authorizationProviders.AuthorizationProviderDataCollection))
            {
                return;
            }

            securitySettings.AuthorizationProviders.Clear();
            foreach (AuthorizationProviderData authorizationProviderData in authorizationProviders.AuthorizationProviderDataCollection)
            {
                securitySettings.AuthorizationProviders[authorizationProviderData.Name] = authorizationProviderData;
            }
        }
Ejemplo n.º 4
0
        public SecuritySettingsNode Build()
        {
            SecuritySettingsNode rootNode = new SecuritySettingsNode();

            AuthorizationProviderCollectionNode authorizationProviderCollectionNode = new AuthorizationProviderCollectionNode();
            this.authorizationProviderCollectionNode_ = authorizationProviderCollectionNode;
            settings.AuthorizationProviders.ForEach(new Action<AuthorizationProviderData>(BuildAuthorizationProviders));

            SecurityCacheProviderCollectionNode securityCacheProviderCollectionNode = new SecurityCacheProviderCollectionNode();
            this.securityCacheProviderCollectionNode_ = securityCacheProviderCollectionNode;
            settings.SecurityCacheProviders.ForEach(new Action<SecurityCacheProviderData>(BuildSecurityCacheProviders));

            rootNode.AddNode(authorizationProviderCollectionNode);
            rootNode.AddNode(securityCacheProviderCollectionNode);

            rootNode.DefaultAuthorizationInstance = defaultAuthorizationNode;
            rootNode.DefaultSecurityCacheInstance = defaultSecurityCacheProviderNode;
            return rootNode;
        }
        public SecuritySettingsNode Build()
        {
            SecuritySettingsNode rootNode = new SecuritySettingsNode();

            AuthorizationProviderCollectionNode authorizationProviderCollectionNode = new AuthorizationProviderCollectionNode();

            this.authorizationProviderCollectionNode_ = authorizationProviderCollectionNode;
            settings.AuthorizationProviders.ForEach(new Action <AuthorizationProviderData>(BuildAuthorizationProviders));

            SecurityCacheProviderCollectionNode securityCacheProviderCollectionNode = new SecurityCacheProviderCollectionNode();

            this.securityCacheProviderCollectionNode_ = securityCacheProviderCollectionNode;
            settings.SecurityCacheProviders.ForEach(new Action <SecurityCacheProviderData>(BuildSecurityCacheProviders));

            rootNode.AddNode(authorizationProviderCollectionNode);
            rootNode.AddNode(securityCacheProviderCollectionNode);

            rootNode.DefaultAuthorizationInstance = defaultAuthorizationNode;
            rootNode.DefaultSecurityCacheInstance = defaultSecurityCacheProviderNode;
            return(rootNode);
        }