FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login

    Create a Tenant using API with Golang

    Scheduled Pinned Locked Moved
    General Discussion
    2
    4
    3.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      milton.jesus
      last edited by

      Hello guys I have been writing a Golang Operator that need to create a fusion auth Tenant and application, but I am facing a problem every time that a run the application the response is Bad request 400

      Version Fusion auth : 1.15.8

      There are some documentation with examples

      Above my payload

      Regards !

      
      {
          "tenant": {
              "emailConfiguration": {
                  "host": "notused.com",
                  "port": 1001,
                  "security": "NONE",
                  "verifyEmail": false,
                  "verifyEmailWhenChanged": false
              },
              "eventConfiguration": {
                  "events": {
                      "jwt.public-key.update": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "jwt.refresh-token.revoke": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.bulk.create": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.create": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.deactivate": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.delete": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.login.failed": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.login.success": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.reactivate": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.registration.create": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.registration.delete": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.registration.update": {
                          "enabled": false,
                          "transactionType": "None"
                      },
                      "user.update": {
                          "enabled": false,
                          "transactionType": "None"
                      }
                  }
              },
              "externalIdentifierConfiguration": {
                  "authorizationGrantIdTimeToLiveInSeconds": 30,
                  "changePasswordIdGenerator": {
                      "length": 32,
                      "type": "randomBytes"
                  },
                  "changePasswordIdTimeToLiveInSeconds": 600,
                  "deviceCodeTimeToLiveInSeconds": 1800,
                  "deviceUserCodeIdGenerator": {
                      "length": 6,
                      "type": "randomAlphaNumeric"
                  },
                  "emailVerificationIdGenerator": {
                      "length": 32,
                      "type": "randomBytes"
                  },
                  "emailVerificationIdTimeToLiveInSeconds": 86400,
                  "externalAuthenticationIdTimeToLiveInSeconds": 300,
                  "oneTimePasswordTimeToLiveInSeconds": 60,
                  "passwordlessLoginGenerator": {
                      "length": 32,
                      "type": "randomBytes"
                  },
                  "passwordlessLoginTimeToLiveInSeconds": 180,
                  "registrationVerificationIdGenerator": {
                      "length": 32,
                      "type": "randomBytes"
                  },
                  "registrationVerificationIdTimeToLiveInSeconds": 86400,
                  "setupPasswordIdGenerator": {
                      "length": 32,
                      "type": "randomBytes"
                  },
                  "setupPasswordIdTimeToLiveInSeconds": 86400,
                  "twoFactorIdTimeToLiveInSeconds": 300,
                  "twoFactorTrustIdTimeToLiveInSeconds": 2592000
              },
              "failedAuthenticationConfiguration": {
                  "actionDuration": 3,
                  "actionDurationUnit": "MINUTES",
                  "resetCountInSeconds": 60,
                  "tooManyAttempts": 5
              },
              "familyConfiguration": {
                  "allowChildRegistrations": true,
                  "deleteOrphanedAccounts": false,
                  "deleteOrphanedAccountsDays": 30,
                  "enabled": false,
                  "maximumChildAge": 12,
                  "minimumOwnerAge": 21,
                  "parentEmailRequired": false
              },
              "httpSessionMaxInactiveInterval": 3600,
              "issuer": "hom.local",
              "jwtConfiguration": {
                  "accessTokenKeyId": "00000-00000-0000-00000-0000000",
                  "enabled": true,
                  "idTokenKeyId": "000000-00000-000000-00000-000000",
                  "refreshTokenTimeToLiveInMinutes": 43200,
                  "timeToLiveInSeconds": 86400
              },
              "maximumPasswordAge": {
                  "days": 15,
                  "enabled": true
              },
              "minimumPasswordAge": {
                  "enabled": false,
                  "seconds": 30
              },
              "name": "ws-company",
              "passwordEncryptionConfiguration": {
                  "encryptionScheme": "salted-pbkdf2-hmac-sha256",
                  "encryptionSchemeFactor": 24000,
                  "modifyEncryptionSchemeOnLogin": false
              },
              "passwordValidationRules": {
                  "breachDetection": {
                      "enabled": false
                  },
                  "maxLength": 256,
                  "minLength": 8,
                  "rememberPreviousPasswords": {
                      "count": 3,
                      "enabled": true
                  },
                  "requireMixedCase": true,
                  "requireNonAlpha": true,
                  "requireNumber": true,
                  "validateOnLogin": false
              },
              "themeId": "700000-000000-00000000-000000000000",
              "userDeletePolicy": {
                  "unverified": {
                      "enabled": false,
                      "numberOfDaysToRetain": 0
                  }
              }
          }
      }
      
      A 1 Reply Last reply Reply Quote 0
      • A
        Alex Patterson @milton.jesus
        last edited by

        @milton-jesus is there a requirement leaving you on 1.15.8?

        Have you tried with latest?

        https://fusionauth.io/docs/release-notes/

        M 1 Reply Last reply Reply Quote 0
        • M
          milton.jesus @Alex Patterson
          last edited by

          @Alex-Patterson Hello I am planning move to recent version, I solve this problem this morning some keys in payload were from new Fusionauth version

          thanks

          A 1 Reply Last reply Reply Quote 0
          • A
            Alex Patterson @milton.jesus
            last edited by

            @milton-jesus awesome glad you solved it!!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post