Skip to content

CDBC service configuration

Overview

In the CDBC service configuration. You can set user authentication method, application authentication , the database connection string and other information.
You can find some examples in different cases at Example configurations

Configurations

<configSections>

Description

Used to add the configuration section declaration. Please don't change it.

XML example

  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
    <section name="cdbcService" type="CdbcServiceUtils.Config.CdbcConfigurationSectionHandler, CdbcServiceUtils"/>
  </configSections>

<cdbcService>

Description

Configurations used by cdbcService.

XML example

  <cdbcService>
    <userAuthentication authMethod="None , Basic or UserPsk">
      <authenticatedUsers>
        <add userId="" userPsk="" comment=""/>
      </authenticatedUsers>
    </userAuthentication>
    <clientApplicationAuthentication authMethod="None or ApplicationPsk">
      <authenticatedApplications>
        <add applicationId="" applicationPsk="" comment="" />
      </authenticatedApplications>
    </clientApplicationAuthentication>
        <idps enabled="true" 
          accessBlockApplicationFailureCount="5"           
          accessBlockUserFailureCount="5" 
          accessBlockIpAdressFailureCount="20" 
          accessBlockSeconds="10" 
          failureResetSeconds="600" 
          clientServerMaxTimeLagSeconds="30" />
    <connectionStrings>
      <add name="" connectionString="" providerName=""/>
    </connectionStrings>
  </cdbcService>

<userAuthentication>

Description

Only authenticated user can access cdbc service. You can configure user authorization method and psks in this session.

<userAuthentication authMethod="None , Basic or UserPsk">

Attributes

Attribute Description Value Remarks
authMethod User authorization method. None , Basic or UserPsk None - No user authorization. Any user can access the service.
Basic - Use IIS basic authorization. Cdbc will not do user authentication.
UserPsk - Use Pre-Shared Key for each user.
<authenticatedUsers>

Description

The authenticated user list can be stored in the authenticatedUsers section. You can use the AuthenticatedUsersCollection to retrieve authenticated users from application configuration files. Its properties map to authenticated user attributes, allowing you to retrieve a single authenticated user specifying the userId.

<authenticatedUsers>
  <add userId="" userPsk="" comment=""/>
</authenticatedUsers>

Attributes

Attribute Description Value Remarks
userId User ID String
userPsk User psk (Pre-Shared Key 16 digital) String
comment Comment about the user, It will not be used by the system String

<clientApplicationAuthentication>

Description

Only the authenticated client application can access cdbc service. You can configure client application authorization method and psks in this session.

    <clientApplicationAuthentication authMethod="None or ApplicationPsk">

Attributes

Attribute Description Value Remarks
authMethod Client application authorization method. None or ApplicationPsk
<authenticatedApplications>

Description

The authenticated applications list can be stored in the authenticatedApplications section. You can use the AuthenticatedApplicationsCollection to retrieve authenticated applications from application configuration files. Its properties map to authenticated application attributes, allowing you to retrieve a single authenticated application specifying the applicationId.

<clientApplicationAuthentication authMethod="None or ApplicationPsk">
    <add applicationId="" applicationPsk="" comment="" />
</clientApplicationAuthentication>

Attributes

Attribute Description Value Remarks
applicationId Applicaion ID String
applicationPsk Applicaion psk (Pre-Shared Key 16 digital) String
comment Comment about the applicaion, It will not be used by the system String

<idps>

Description

Idps is used to block illegal access. The accesses will be blocked for a specified time period while authorization failed certain time.

        <idps enabled="true" 
          accessBlockApplicationFailureCount="5"           
          accessBlockUserFailureCount="5" 
          accessBlockIpAdressFailureCount="20" 
          accessBlockSeconds="10" 
          failureResetSeconds="600"  />          
Attributes

Attribute Description Value Remarks
enabled Enable or disable Idps. If Idps is enabled , Cdbc service will block the accesses after authorization failed certain times. true or false
default true
accessBlockApplicationFailureCount Used to set the application authorization failure count while start block. int>=1
default 5
Count access from same ip and same application id
accessBlockUserFailureCount Used to set the user authorization failure count while start block. int>=1
default 5
Count access from same ip and same user id
accessBlockIpAdressFailureCount Used to set the authorization failure count from the same ip while start to block access. int>=1
default 20
Count access from same ip
accessBlockSeconds Used to set how many seconds will the access be blocked. int>=1
default 10
failureResetSeconds If there is no authorization error after a certain seconds the failure count will be reset to 0. failureResetSeconds is used to set the reset time. int>accessBlockSeconds
default 600

<connectionStrings>

Description

Connection strings used by cdbc service can be stored in the connectionStrings section. Please refer microsoft's document to see the details about connectionStrings.

    <connectionStrings>
      <add name="" connectionString="" providerName=""/>
    </connectionStrings>

<log4net>

XML

Description

Cdbc use log4net to log system and audit log.
Please refer log4net's document to see the details.

  <log4net>
    <appender name="RollingLogFileAppenderSystem" type="log4net.Appender.RollingFileAppender,log4net">
    ...
    </appender>
    <appender name="RollingLogFileAppenderAudit" type="log4net.Appender.RollingFileAppender,log4net">
    ...
    </appender>
    <logger name="audit">
      <appender-ref ref="RollingLogFileAppenderAudit"/>
    </logger>
    <logger name="system">
      <appender-ref ref="RollingLogFileAppenderSystem"/>
    </logger>
  </log4net>

<serviceModel>

Description

serviceModel session includes some wcf configurations for cdbc service . You can modify it to fit your requirement if you have deep knowledge about wcf. Please refer Microsoft's document to see the details.

  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding maxReceivedMessageSize="5798464">
        </binding>
      </basicHttpBinding>
      <basicHttpsBinding>
        <binding maxReceivedMessageSize="5798464">
        </binding>
      </basicHttpsBinding>
    </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior>
          <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false"/>
          <serviceDebug includeExceptionDetailInFaults="false" httpHelpPageEnabled="false" httpsHelpPageEnabled="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <protocolMapping>
        <add binding="basicHttpsBinding" scheme="https" />
    </protocolMapping>    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

Back to index page