Skip to content

Commit

Permalink
f/azurecli-auth: exposing the provider specific docs uri
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Jul 15, 2019
1 parent 9393cd0 commit a8d090b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions authentication/auth_method_azure_cli_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (

type azureCliTokenAuth struct {
profile *azureCLIProfile
servicePrincipalAuthDocsLink string
}

func (a azureCliTokenAuth) build(b Builder) (authMethod, error) {
Expand All @@ -25,6 +26,7 @@ func (a azureCliTokenAuth) build(b Builder) (authMethod, error) {
subscriptionId: b.SubscriptionID,
tenantId: b.TenantID,
},
servicePrincipalAuthDocsLink: b.ClientSecretDocsLink,
}
profilePath, err := cli.ProfilePath()
if err != nil {
Expand All @@ -44,9 +46,9 @@ func (a azureCliTokenAuth) build(b Builder) (authMethod, error) {
return nil, fmt.Errorf(`Authenticating using the Azure CLI is only supported as a User (not a Service Principal).
To authenticate to Azure using a Service Principal, you can use the separate 'Authenticate using a Service Principal'
auth method - instructions for which can be found in the documentation.
auth method - instructions for which can be found here: %s
Alternatively you can authenticate using the Azure CLI by using a User Account.`)
Alternatively you can authenticate using the Azure CLI by using a User Account.`, auth.servicePrincipalAuthDocsLink)
}

err = auth.profile.populateFields()
Expand Down
1 change: 1 addition & 0 deletions authentication/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ type Builder struct {
// Service Principal (Client Secret) Auth
SupportsClientSecretAuth bool
ClientSecret string
ClientSecretDocsLink string
}

// Build takes the configuration from the Builder and builds up a validated Config
Expand Down

0 comments on commit a8d090b

Please sign in to comment.