Skip to content

Commit

Permalink
check for authorityHost override only if tenantId is also set
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldotyu committed Feb 24, 2024
1 parent 672f9eb commit 3c43c45
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pkg/scalers/azure/azure_aad_workload_identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,20 @@ func init() {
// GetAzureADWorkloadIdentityToken returns the AADToken for resource
func GetAzureADWorkloadIdentityToken(ctx context.Context, identityID, identityTenantID, identityAuthorityHost, resource string) (AADToken, error) {
clientID := DefaultClientID
tenantID := DefaultTenantID
authorityHost := DefaultAuthorityHost

if identityID != "" {
clientID = identityID
}

tenantID := DefaultTenantID
if identityTenantID != "" {
tenantID = identityTenantID
}

authorityHost := DefaultAuthorityHost
if identityAuthorityHost != "" {
authorityHost = identityAuthorityHost
// override the authority host only if provided and tenant id is provided
if identityAuthorityHost != "" {
authorityHost = identityAuthorityHost
}
}

signedAssertion, err := readJWTFromFileSystem(TokenFilePath)
Expand Down

0 comments on commit 3c43c45

Please sign in to comment.