Click or drag to resize

Types of authentication

During the development of a custom app you need to define an endpoint (the name or IP address of the server where the Settings Storage WCF Service is installed) that will act as a doorway in communication between the custom app and the Setting Storage WCF Service realized via API. An endpoint will not be configured by default - you need to add the system.serviceModel configuration to the Web.config (in the case of custom web apps only) or App.config file (in the case of custom apps other than web apps) in your project. Once you do that, the endpoint element will be added to the file with the default address pointing to localhost. Additionally, the address will include information on the authentication type that will be used every time a user starts the custom app to connect to the Settings Storage WCF Service. Furthermore, the authentication will be set to No authentication so you do not need to change it to get access to the Settings Storage WCF Service. However, if you want to configure the authentication type (e.g. due to security precautions in your company), you may modify it by using the other two available authentication types (read more below). All these authentication types depend on Access Rights set within the Administration Panel of CodeTwo Exchange Rules Pro.

Note Note

To learn more about the configuration of the endpoint, go to step 5 of the ASP.NET web app development walkthrough.

There are three types of authentication available (including the default No authentication option). The examples below show how to configure endpoints (including the authentication types) in the Web.config file of a custom web app project:

  • No authentication - the default type that is set during the development of a custom app. In this case, no authentication is required to connect to the Settings Storage WCF Service. An example of the Web.config file with the authentication set to No authentication is shown below.

    Web.config
    <?xml version="1.0"?>
    <configuration>
        <system.web>
          <compilation debug="true" targetFramework="4.5" />
          <httpRuntime targetFramework="4.5" />
        </system.web>
    
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="SettingsStorageHttpEndpoint" />
          </basicHttpBinding>
          <wsHttpBinding>
            <binding name="MetadataExchangeHttpBinding_ISettingsStorage">
              <security mode="None" />
            </binding>
          </wsHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:5020/ER.Engine/SettingsStorage/NoAuth"
              binding="basicHttpBinding" bindingConfiguration="SettingsStorageHttpEndpoint"
              contract="ER.SDK.ISettingsStorage" name="SettingsStorageHttpEndpoint" />
          <endpoint address="http://localhost:5020/ER.Engine/SettingsStorage/NoAuth/mex"
              binding="wsHttpBinding" bindingConfiguration="MetadataExchangeHttpBinding_ISettingsStorage"
              contract="ER.SDK.ISettingsStorage" name="MetadataExchangeHttpBinding_ISettingsStorage" />
        </client>
      </system.serviceModel>
    </configuration>
  • Windows authentication – all domain users or only defined domain users will be able to use the app and connect to the Settings Storage WCF Service. This type of authentication will work for all domain users if the Access Rights Management checkbox is cleared (not selected) in the Access Rights settings in the Administration Panel of the program. If the mentioned checkbox is selected (checked, only authorized users will have the right to manage the custom app and connect to the Settings Storage WCF Service. An example of the Web.config file with the authentication set to Windows authentication is shown below.

    Web.config
    <?xml version="1.0"?>
    <configuration>
        <system.web>
          <compilation debug="true" targetFramework="4.5" />
          <httpRuntime targetFramework="4.5" />
        </system.web>
    
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="SettingsStorageHttpEndpoint" />
          </basicHttpBinding>
          <wsHttpBinding>
            <binding name="MetadataExchangeHttpBinding_ISettingsStorage">
              <security mode="None" />
            </binding>
          </wsHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:5020/ER.Engine/SettingsStorage/"
              binding="basicHttpBinding" bindingConfiguration="SettingsStorageHttpEndpoint"
              contract="ER.SDK.ISettingsStorage" name="SettingsStorageHttpEndpoint" />
          <endpoint address="http://localhost:5020/ER.Engine/SettingsStorage/mex"
              binding="wsHttpBinding" bindingConfiguration="MetadataExchangeHttpBinding_ISettingsStorage"
              contract="ER.SDK.ISettingsStorage" name="MetadataExchangeHttpBinding_ISettingsStorage" />
        </client>
      </system.serviceModel>
    </configuration>
  • Custom authentication – only external users defined in the Access Rights settings in the Administration Panel of the program can connect to the Settings Storage WCF Service. An example of the Web.config file with the authentication set to Custom authentication is shown below.

    Web.config
    <?xml version="1.0"?>
    <configuration>
        <system.web>
          <compilation debug="true" targetFramework="4.5" />
          <httpRuntime targetFramework="4.5" />
        </system.web>
    
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="SettingsStorageHttpEndpoint" />
          </basicHttpBinding>
          <wsHttpBinding>
            <binding name="MetadataExchangeHttpBinding_ISettingsStorage">
              <security mode="None" />
            </binding>
          </wsHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:5020/ER.Engine/SettingsStorage/CustomAuth"
              binding="basicHttpBinding" bindingConfiguration="SettingsStorageHttpEndpoint"
              contract="ER.SDK.ISettingsStorage" name="SettingsStorageHttpEndpoint" />
          <endpoint address="http://localhost:5020/ER.Engine/SettingsStorage/CustomAuth/mex"
              binding="wsHttpBinding" bindingConfiguration="MetadataExchangeHttpBinding_ISettingsStorage"
              contract="ER.SDK.ISettingsStorage" name="MetadataExchangeHttpBinding_ISettingsStorage" />
        </client>
      </system.serviceModel>
    </configuration>