Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions src/main/java/io/fusionauth/client/FusionAuthClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@
import io.fusionauth.domain.api.report.MonthlyActiveUserReportResponse;
import io.fusionauth.domain.api.report.RegistrationReportResponse;
import io.fusionauth.domain.api.report.TotalsReportResponse;
import io.fusionauth.domain.api.tenantManager.TenantManagerIdentityProviderTypeConfigurationRequest;
import io.fusionauth.domain.api.tenantManager.TenantManagerIdentityProviderTypeConfigurationResponse;
import io.fusionauth.domain.api.twoFactor.SecretResponse;
import io.fusionauth.domain.api.twoFactor.TwoFactorLoginRequest;
import io.fusionauth.domain.api.twoFactor.TwoFactorSendRequest;
Expand Down Expand Up @@ -1167,6 +1169,22 @@ public ClientResponse<TenantResponse, Errors> createTenant(UUID tenantId, Tenant
.go();
}

/**
* Creates a tenant manager identity provider type configuration for the given identity provider type.
*
* @param type The type of the identity provider.
* @param request The request object that contains all the information used to create the tenant manager identity provider type configuration.
* @return The ClientResponse object.
*/
public ClientResponse<TenantManagerIdentityProviderTypeConfigurationResponse, Errors> createTenantManagerIdentityProviderTypeConfiguration(IdentityProviderType type, TenantManagerIdentityProviderTypeConfigurationRequest request) {
return start(TenantManagerIdentityProviderTypeConfigurationResponse.class, Errors.class)
.uri("/api/tenant-manager/identity-provider")
.urlSegment(type)
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
.post()
.go();
}

/**
* Creates a Theme. You can optionally specify an Id for the theme, if not provided one will be generated.
*
Expand Down Expand Up @@ -1747,6 +1765,20 @@ public ClientResponse<Void, Errors> deleteTenantAsync(UUID tenantId) {
.go();
}

/**
* Deletes the tenant manager identity provider type configuration for the given identity provider type.
*
* @param type The type of the identity provider.
* @return The ClientResponse object.
*/
public ClientResponse<Void, Errors> deleteTenantManagerIdentityProviderTypeConfiguration(IdentityProviderType type) {
return start(Void.TYPE, Errors.class)
.uri("/api/tenant-manager/identity-provider")
.urlSegment(type)
.delete()
.go();
}

/**
* Deletes the tenant based on the given request (sent to the API as JSON). This permanently deletes all information, metrics, reports and data associated
* with the tenant and everything under the tenant (applications, users, etc).
Expand Down Expand Up @@ -3016,6 +3048,22 @@ public ClientResponse<TenantResponse, Errors> patchTenant(UUID tenantId, Map<Str
.go();
}

/**
* Patches the tenant manager identity provider type configuration for the given identity provider type.
*
* @param type The type of the identity provider.
* @param request The request object that contains the new tenant manager identity provider type configuration information.
* @return The ClientResponse object.
*/
public ClientResponse<TenantManagerIdentityProviderTypeConfigurationResponse, Errors> patchTenantManagerIdentityProviderTypeConfiguration(IdentityProviderType type, Map<String, Object> request) {
return start(TenantManagerIdentityProviderTypeConfigurationResponse.class, Errors.class)
.uri("/api/tenant-manager/identity-provider")
.urlSegment(type)
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
.patch()
.go();
}

/**
* Updates, via PATCH, the theme with the given Id.
*
Expand Down Expand Up @@ -6106,6 +6154,22 @@ public ClientResponse<TenantResponse, Errors> updateTenant(UUID tenantId, Tenant
.go();
}

/**
* Updates the tenant manager identity provider type configuration for the given identity provider type.
*
* @param type The type of the identity provider.
* @param request The request object that contains the updated tenant manager identity provider type configuration.
* @return The ClientResponse object.
*/
public ClientResponse<TenantManagerIdentityProviderTypeConfigurationResponse, Errors> updateTenantManagerIdentityProviderTypeConfiguration(IdentityProviderType type, TenantManagerIdentityProviderTypeConfigurationRequest request) {
return start(TenantManagerIdentityProviderTypeConfigurationResponse.class, Errors.class)
.uri("/api/tenant-manager/identity-provider")
.urlSegment(type)
.bodyHandler(new JSONBodyHandler(request, objectMapper()))
.put()
.go();
}

/**
* Updates the theme with the given Id.
*
Expand Down
13 changes: 9 additions & 4 deletions src/main/java/io/fusionauth/domain/SystemConfiguration.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

import com.inversoft.json.JacksonConstructor;
import com.inversoft.json.ToString;
import io.fusionauth.domain.tenantManager.TenantManagerIdentityProviderTypeConfiguration;

/**
* @author Brian Pontarelli
Expand Down Expand Up @@ -292,13 +293,16 @@ public static class TenantManagerConfiguration implements Buildable<TenantManage

public String brandName;

public Map<String, TenantManagerIdentityProviderTypeConfiguration> identityProviderTypeConfigurations = new HashMap<>();

@JacksonConstructor
public TenantManagerConfiguration() {
}

public TenantManagerConfiguration(TenantManagerConfiguration other) {
this.brandName = other.brandName;
this.attributeFormId = other.attributeFormId;
this.brandName = other.brandName;
this.identityProviderTypeConfigurations.putAll(other.identityProviderTypeConfigurations);
}

@Override
Expand All @@ -310,13 +314,14 @@ public boolean equals(Object o) {
return false;
}
TenantManagerConfiguration that = (TenantManagerConfiguration) o;
return Objects.equals(brandName, that.brandName) &&
Objects.equals(attributeFormId, that.attributeFormId);
return Objects.equals(attributeFormId, that.attributeFormId) &&
Objects.equals(brandName, that.brandName) &&
Objects.equals(identityProviderTypeConfigurations, that.identityProviderTypeConfigurations);
}

@Override
public int hashCode() {
return Objects.hash(brandName, attributeFormId);
return Objects.hash(attributeFormId, brandName, identityProviderTypeConfigurations);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2026, FusionAuth, All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
package io.fusionauth.domain.api.tenantManager;

import com.inversoft.json.JacksonConstructor;
import io.fusionauth.domain.tenantManager.TenantManagerIdentityProviderTypeConfiguration;

/**
* The Tenant Manager IdP type configuration request object
*/
public class TenantManagerIdentityProviderTypeConfigurationRequest {
public TenantManagerIdentityProviderTypeConfiguration typeConfiguration;

@JacksonConstructor
public TenantManagerIdentityProviderTypeConfigurationRequest() {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2026, FusionAuth, All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
package io.fusionauth.domain.api.tenantManager;

import com.inversoft.json.JacksonConstructor;
import io.fusionauth.domain.tenantManager.TenantManagerIdentityProviderTypeConfiguration;

/**
* The Tenant Manager IdP type configuration response object
*/
public class TenantManagerIdentityProviderTypeConfigurationResponse {
public TenantManagerIdentityProviderTypeConfiguration typeConfiguration;

@JacksonConstructor
public TenantManagerIdentityProviderTypeConfigurationResponse() {
}

public TenantManagerIdentityProviderTypeConfigurationResponse(TenantManagerIdentityProviderTypeConfiguration typeConfiguration) {
this.typeConfiguration = typeConfiguration;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/*
* Copyright (c) 2026, FusionAuth, All Rights Reserved
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*/
package io.fusionauth.domain.tenantManager;

import java.time.ZonedDateTime;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Objects;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.inversoft.json.JacksonConstructor;
import com.inversoft.json.ToString;
import io.fusionauth.domain.Buildable;
import io.fusionauth.domain.Enableable;
import io.fusionauth.domain.provider.IdentityProviderLinkingStrategy;
import io.fusionauth.domain.provider.IdentityProviderType;

/**
* Configuration object for identity provider types allowed in Tenant Manager
*/
public class TenantManagerIdentityProviderTypeConfiguration extends Enableable implements Buildable<TenantManagerIdentityProviderTypeConfiguration> {
@JsonIgnore
public Map<String, Object> data = new LinkedHashMap<>();

public Map<String, String> defaultAttributeMappings = new HashMap<>();

public ZonedDateTime insertInstant;

public ZonedDateTime lastUpdateInstant;

public IdentityProviderLinkingStrategy linkingStrategy;

public IdentityProviderType type;

@JacksonConstructor
public TenantManagerIdentityProviderTypeConfiguration() {
}

public TenantManagerIdentityProviderTypeConfiguration(TenantManagerIdentityProviderTypeConfiguration other) {
this.data.putAll(other.data);
this.defaultAttributeMappings.putAll(other.defaultAttributeMappings);
this.insertInstant = other.insertInstant;
this.lastUpdateInstant = other.lastUpdateInstant;
this.linkingStrategy = other.linkingStrategy;
this.type = other.type;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
if (!super.equals(o)) {
return false;
}
TenantManagerIdentityProviderTypeConfiguration that = (TenantManagerIdentityProviderTypeConfiguration) o;
return Objects.equals(defaultAttributeMappings, that.defaultAttributeMappings) &&
Objects.equals(insertInstant, that.insertInstant) &&
Objects.equals(lastUpdateInstant, that.lastUpdateInstant) &&
linkingStrategy == that.linkingStrategy &&
type == that.type;
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), defaultAttributeMappings, insertInstant, lastUpdateInstant, linkingStrategy, type);
}

@Override
public String toString() {
return ToString.toString(this);
}
}