Back to Learn Hub

DaisiStaticSettings

Namespace: Daisi.SDK.Models

This is a static helper class for configuring various SDK defaults.

Static Properties

  • string? ClientKey get and set
    The client key that will be passed to the Orc and Hosts if using static client keys for your app. Your app's client key should not be the same as your Users'' client keys if you are using Daisi Authentication.
  • string ClientKeyHeader get
    This is the header that the Orcs and Hosts will be looking for during authentication and authorization.
  • IClientKeyProvider DefaultClientKeyProvider get
    Setting this value will allow you to create any of the client factory classes without having an instance of a IClientKeyProvider.
  • string NetworkName get and set
    Allows consumers to set the network that they want to use by name. Default is "devnet".
  • string OrcIpAddressOrDomain get and set
    This is the IpAddress ("192.168.1.100") or domain ("orc-dev.daisinet.com") for the Orc that you intend to connect to. Your app will be assigned an orc automatically or you can assign it manually in the app startup by setting this value.
  • int OrcPort get and set
    This is the publicly exposed port number that your Orc uses for incoming connections. Default is 443, for SSL.
  • string OrcUrl get
    Gets the full Url for the Orc that is currently setup by combining the domain, ssl settings, and port.
  • bool OrcUseSSL get and set
    Determines whether your Orc uses SSL or not. Highly recommended that you leave this as the default value of True. If you have a situation where you need to connect to an Orc without SSL in a production environment, please understand that these connections will not be secure and you will potentially expose important information.
  • string Protocol get
    Helper function. Returns "https" is OrcUseSSL is true or "http" if OrcUseSSL is false.
  • string? SecretKey get and set
    This is your app's secret key. This is only sent to the Orcs and never exposed to Hosts. You should keep it a secret as well, hence the name.
  • string? SsoSigningKey get and set
    Base64-encoded AES-256 key shared across SSO-participating apps. Used to encrypt and decrypt SSO tickets during cross-app authentication. Must be the same value on the authority (Manager) and all relying-party apps. Configure via Daisi:SsoSigningKey.
  • string? SsoAuthorityUrl get and set
    Base URL of the SSO authority (Identity Provider), e.g. "https://manager.daisinet.com". Unauthenticated users on relying-party apps are redirected here to log in. Configure via Daisi:SsoAuthorityUrl.
  • string? SsoAppUrl get and set
    This app's own base URL, used to build the SSO callback URL (e.g. "https://drive.daisinet.com"). Configure via Daisi:SsoAppUrl.
  • string[]? SsoAllowedOrigins get and set
    Origins allowed to request SSO tickets from this app's /sso/authorize endpoint. Requests with an origin not in this list are rejected with HTTP 400. Configure via Daisi:SsoAllowedOrigins (comma-separated).

Static Methods

  • void AutoswapOrc()
    If the app is running in Debug mode, it will set the NetworkName to "devnet". If it is running in Release mode, it will set the NetworkName to "mainnet".
  • void LoadFromConfiguration(IDictionary<string,string> configuration)
    Loads these static settings from a config dictionary.
  • void LoadFromConfiguration(string sectionName)
    Loads these static settings from the app.config file for your application, given the section name.
// Set values in code
DaisiStaticSettings.OrcIpAddressOrDomain = "orc.daisinet.com";
DaisiStaticSettings.OrcPort = 443;
DaisiStaticSettings.OrcUseSSL = true;
DaisiStaticSettings.SecretKey = "secret-...";