mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-02 22:34:56 -04:00
cli: use uami for in-cluter authentication (#1820)
This commit is contained in:
parent
9502bc8ff4
commit
661f084ffa
13 changed files with 65 additions and 117 deletions
|
@ -449,13 +449,19 @@ func (i *initCmd) getMarshaledServiceAccountURI(provider cloudprovider.Provider,
|
|||
return "", nil // AWS does not need a service account URI
|
||||
case cloudprovider.Azure:
|
||||
i.log.Debugf("Handling case for Azure")
|
||||
|
||||
// TODO(3u13r): Remove this fallback and enforce assigned managed identity after the v2.8.0 but before the v2.9.0 release.
|
||||
authMethod := azureshared.AuthMethodUserAssignedIdentity
|
||||
if config.Provider.Azure.AppClientID != "" {
|
||||
authMethod = azureshared.AuthMethodServicePrincipal
|
||||
}
|
||||
|
||||
creds := azureshared.ApplicationCredentials{
|
||||
TenantID: config.Provider.Azure.TenantID,
|
||||
AppClientID: config.Provider.Azure.AppClientID,
|
||||
ClientSecretValue: config.Provider.Azure.ClientSecretValue,
|
||||
Location: config.Provider.Azure.Location,
|
||||
// TODO(malt3): Switch preferred auth method to uami as planned by AB#2961
|
||||
PreferredAuthMethod: azureshared.AuthMethodServicePrincipal,
|
||||
TenantID: config.Provider.Azure.TenantID,
|
||||
AppClientID: config.Provider.Azure.AppClientID,
|
||||
ClientSecretValue: config.Provider.Azure.ClientSecretValue,
|
||||
Location: config.Provider.Azure.Location,
|
||||
PreferredAuthMethod: authMethod,
|
||||
UamiResourceID: config.Provider.Azure.UserAssignedIdentity,
|
||||
}
|
||||
return creds.ToCloudServiceAccountURI(), nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue