• Home
  • Categories
  • Recent
  • Popular
  • Pricing
  • Contact us
  • Docs
  • Login
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.6k
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 9 Sept 2024, 13:37

    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 9 Sept 2024, 17:11 Reply Quote 0
    • A
      Alex Patterson @milton.jesus
      last edited by 9 Sept 2024, 17:11

      @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 10 Sept 2024, 19:57 Reply Quote 0
      • M
        milton.jesus @Alex Patterson
        last edited by 10 Sept 2024, 19:57

        @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 12 Sept 2024, 15:15 Reply Quote 0
        • A
          Alex Patterson @milton.jesus
          last edited by 12 Sept 2024, 15:15

          @milton-jesus awesome glad you solved it!!

          1 Reply Last reply Reply Quote 0
          4 out of 4
          • First post
            4/4
            Last post