Is it possible to get ACS claims without editing web.config?

后端 未结 3 1852
无人及你
无人及你 2021-02-06 06:37

Is it possible to set up the realm URL, claim types, etc for azure ACS without editing the web.config? Can you set up these required elements programmatically somehow?

E

3条回答
  •  鱼传尺愫
    2021-02-06 07:33

    To remove that xml line from the web config, I made my own WSFederationAuthenticationModule overriding the old one, like so:

    public class CustomWSFederationAuthenticationModule : WSFederationAuthenticationModule
    {
        protected override void InitializePropertiesFromConfiguration(string serviceName)
        {
            this.Realm = "http://localhost:81/";
            this.Issuer = "https://acsnamespace.accesscontrol.windows.net/v2/wsfederation";
            this.RequireHttps = false;
            this.PassiveRedirectEnabled = true;
        }
    }
    

    And the important part of the web.config:

    
      
      
    
    

    Also the federatedAuthentication section of the XML is removed entirely.

提交回复
热议问题