diff --git a/.github/workflows/standalone-azuread.json b/.github/workflows/standalone-azuread.json index 6dc3613c36..f80f4d2d6f 100644 --- a/.github/workflows/standalone-azuread.json +++ b/.github/workflows/standalone-azuread.json @@ -12,6 +12,7 @@ "azuread/105-azuread-application-with-optional-claims", "azuread/106-azuread-application-with-api-scopes", "azuread/108-azuread-application-with-app-roles", + "azuread/109-azuread-application-with-public-client", "azuread/201-groups-and-roles" ] } diff --git a/examples/azuread/107-azuread-application-with-single-page-application/configuration.tfvars b/examples/azuread/107-azuread-application-with-single-page-application/configuration.tfvars index 60ddaeb879..b55e93872f 100644 --- a/examples/azuread/107-azuread-application-with-single-page-application/configuration.tfvars +++ b/examples/azuread/107-azuread-application-with-single-page-application/configuration.tfvars @@ -27,9 +27,9 @@ azuread_apps = { azuread_applications = { test_client_v1 = { - useprefix = true - application_name = "test-client-v1" - public_client = true + useprefix = true + application_name = "test-client-v1" + fallback_public_client_enabled = true single_page_application = { redirect_uris = [ @@ -55,4 +55,4 @@ azuread_applications = { ] } } -} \ No newline at end of file +} diff --git a/examples/azuread/109-azuread-application-with-public-client/configuration.tfvars b/examples/azuread/109-azuread-application-with-public-client/configuration.tfvars new file mode 100644 index 0000000000..2981332a1d --- /dev/null +++ b/examples/azuread/109-azuread-application-with-public-client/configuration.tfvars @@ -0,0 +1,17 @@ +global_settings = { + default_region = "region1" + regions = { + region1 = "australiaeast" + } + random_length = 5 +} + +azuread_applications = { + test_client = { + useprefix = true + application_name = "test-client" + public_client = { + redirect_uris = ["http://localhost:8080"] + } + } +} diff --git a/modules/azuread/applications_v1/azuread_application.tf b/modules/azuread/applications_v1/azuread_application.tf index 900ea16d26..279aa44807 100644 --- a/modules/azuread/applications_v1/azuread_application.tf +++ b/modules/azuread/applications_v1/azuread_application.tf @@ -13,7 +13,7 @@ resource "azuread_application" "app" { group_membership_claims = try(var.settings.group_membership_claims, ["All"]) identifier_uris = try(var.settings.identifier_uris, null) prevent_duplicate_names = try(var.settings.prevent_duplicate_names, false) - fallback_public_client_enabled = try(var.settings.public_client, false) + fallback_public_client_enabled = try(var.settings.fallback_public_client_enabled, false) dynamic "single_page_application" { for_each = try(var.settings.single_page_application, null) != null ? [1] : [] @@ -123,6 +123,12 @@ resource "azuread_application" "app" { } } } + dynamic "public_client" { + for_each = try(var.settings.public_client, null) != null ? [var.settings.public_client] : [] + content { + redirect_uris = try(public_client.value.redirect_uris, null) + } + } } resource "random_uuid" "app_role_id" {