Skip to content

Commit

Permalink
bugfix: client certificate authentication doesn't work (#479)
Browse files Browse the repository at this point in the history
* bugfix: client certificate authentication doesn't work

* fix axuiliary tenant
  • Loading branch information
ms-henglu committed Apr 26, 2024
1 parent dcdb423 commit 9485028
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ BUG FIXES:
- Fix a bug that `azapi_resource` resource cannot handle tags with unknown values.
- Fix a bug that `null` value can't pass the schema validation.
- Fix a bug that schema validation fails to validate the float number in the body.
- Fix a bug that client certificate authentication doesn't work.
- Fix a bug that auxiliary tenant ids are not passed to the client.

## v1.13.0
BREAKING CHANGES:
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,17 +566,17 @@ func (p Provider) Configure(ctx context.Context, request provider.ConfigureReque
_ = os.Setenv("AZURE_CLIENT_SECRET", *v)
}
if v := model.ClientCertificatePath.ValueString(); v != "" {
_ = os.Setenv("AZURE_CERTIFICATE_PATH", v)
_ = os.Setenv("AZURE_CLIENT_CERTIFICATE_PATH", v)
}
if v := model.ClientCertificatePassword.ValueString(); v != "" {
_ = os.Setenv("AZURE_CERTIFICATE_PASSWORD", v)
_ = os.Setenv("AZURE_CLIENT_CERTIFICATE_PASSWORD", v)
}
var auxTenants []string
if elements := model.AuxiliaryTenantIDs.Elements(); len(elements) != 0 {
for _, element := range elements {
auxTenants = append(auxTenants, element.(basetypes.StringValue).ValueString())
}
_ = os.Setenv("AZURE_AUXILIARY_TENANT_IDS", strings.Join(auxTenants, ";"))
_ = os.Setenv("AZURE_ADDITIONALLY_ALLOWED_TENANTS", strings.Join(auxTenants, ";"))
}

option := &azidentity.DefaultAzureCredentialOptions{
Expand Down

0 comments on commit 9485028

Please sign in to comment.