Ejemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountConfigCrossbarAuth" /> class.
 /// </summary>
 /// <param name="authModules">authModules (required).</param>
 public AccountConfigCrossbarAuth(AccountConfigCrossbarAuthAuthModules authModules = default(AccountConfigCrossbarAuthAuthModules))
 {
     // to ensure "authModules" is required (not null)
     if (authModules == null)
     {
         throw new InvalidDataException("authModules is a required property for AccountConfigCrossbarAuth and cannot be null");
     }
     else
     {
         this.AuthModules = authModules;
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SystemConfigCrossbarAuth" /> class.
 /// </summary>
 /// <param name="authModules">authModules.</param>
 /// <param name="availableAuthMethods">List of crossbar auth configurable modules.</param>
 /// <param name="basicAuthType">crossbar.auth basic auth type (default to BasicAuthTypeEnum.Md5).</param>
 /// <param name="logFailedAttempts">Should log failed login attempts (default to false).</param>
 /// <param name="logFailedLoginAttempts">Should log failed login attempts (default to false).</param>
 /// <param name="logSuccessfulAttempts">Should log successful login attempts (default to false).</param>
 /// <param name="tokenAuthExpiryS">crossbar token auth expiry in seconds.</param>
 public SystemConfigCrossbarAuth(AccountConfigCrossbarAuthAuthModules authModules = default(AccountConfigCrossbarAuthAuthModules), List <string> availableAuthMethods = default(List <string>), BasicAuthTypeEnum?basicAuthType = BasicAuthTypeEnum.Md5, bool?logFailedAttempts = false, bool?logFailedLoginAttempts = false, bool?logSuccessfulAttempts = false, int?tokenAuthExpiryS = default(int?))
 {
     this.AuthModules          = authModules;
     this.AvailableAuthMethods = availableAuthMethods;
     // use default value if no "basicAuthType" provided
     if (basicAuthType == null)
     {
         this.BasicAuthType = BasicAuthTypeEnum.Md5;
     }
     else
     {
         this.BasicAuthType = basicAuthType;
     }
     // use default value if no "logFailedAttempts" provided
     if (logFailedAttempts == null)
     {
         this.LogFailedAttempts = false;
     }
     else
     {
         this.LogFailedAttempts = logFailedAttempts;
     }
     // use default value if no "logFailedLoginAttempts" provided
     if (logFailedLoginAttempts == null)
     {
         this.LogFailedLoginAttempts = false;
     }
     else
     {
         this.LogFailedLoginAttempts = logFailedLoginAttempts;
     }
     // use default value if no "logSuccessfulAttempts" provided
     if (logSuccessfulAttempts == null)
     {
         this.LogSuccessfulAttempts = false;
     }
     else
     {
         this.LogSuccessfulAttempts = logSuccessfulAttempts;
     }
     this.TokenAuthExpiryS = tokenAuthExpiryS;
 }