You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The result is satisfactory, as I get the new Tenant with the default configuration plus the customisations specified in the request.
On the other hand, when using the CreateTenant method of the client, if I specify in the SourceTenantId property the identifier of the base Tenant, the resulting Tenant does not have the custom properties.
func (h *Handler) CreateTenant(name string) (*fusionauth.TenantResponse, *fusionauth.Errors, error) {
tr := fusionauth.TenantRequest{
// if this property is uncommented, the result is the configuration of DefaultTenant
// SourceTenantId: "1477a639-1027-1fdb-b6cc-f19a162865a9",
Tenant: fusionauth.Tenant{
Name: name,
Issuer: "udrafter.com",
EmailConfiguration: fusionauth.EmailConfiguration{
DefaultFromEmail: "[email protected]",
DefaultFromName: "foobar",
Host: "smt.foobar.com",
ImplicitEmailVerificationAllowed: false,
Password: "password",
Port: 465,
Security: "SSL",
Username: "foobar",
},
PasswordEncryptionConfiguration: fusionauth.PasswordEncryptionConfiguration{
EncryptionScheme: "bcrypt",
EncryptionSchemeFactor: 6,
},
},
}
r, faerrors, err := h.FusionAuth.CreateTenant("", tr)
if err != nil {
return nil, faerrors, err
}
return r, faerrors, nil
}
I understand that this behaviour does not correspond to the behaviour obtained using Tenant APIs and to what is discussed in this section of the documentation:
sourceTenantId [UUID] OPTIONAL AVAILABLE SINCE 1.14.0
The optional Id of an existing Tenant to make a copy of. A unique tenant.name is required. If present, the tenant.id value will used for the new Tenant. All other values will be copied from the source Tenant to the new Tenant.
The text was updated successfully, but these errors were encountered:
josedelrio85
changed the title
Create tenant with SourceTenantId does not behave as expected
CreateTenant with SourceTenantId does not behave as expected
Feb 17, 2022
@josedelrio85 hmmm. So re-reading the issue, it appears that the client and the tenant API have different behavior when additional fields are added to a sourceTenantId call.
Is that correct?
One workaround is to create the tenant in two steps. Will that not work for you for some reason?
I have created a tenant using Tenant APIs using the Default Tenant as a base, but trying to add customisations, in this case email settings.
POST api/tenant
The result is satisfactory, as I get the new Tenant with the default configuration plus the customisations specified in the request.
On the other hand, when using the
CreateTenant
method of the client, if I specify in theSourceTenantId
property the identifier of the base Tenant, the resulting Tenant does not have the custom properties.I understand that this behaviour does not correspond to the behaviour obtained using Tenant APIs and to what is discussed in this section of the documentation:
The text was updated successfully, but these errors were encountered: