authentication

package
v1.18.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 2, 2018 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetermineEnvironment added in v1.18.0

func DetermineEnvironment(name string) (*azure.Environment, error)

DetermineEnvironment determines what the Environment name is within the Azure SDK for Go and then returns the association environment, if it exists.

func GetAuthorizationToken added in v1.18.0

func GetAuthorizationToken(c *Config, oauthConfig *adal.OAuthConfig, endpoint string) (*autorest.BearerAuthorizer, error)

GetAuthorizationToken returns an authentication token for the current authentication method

Types

type AccessToken

type AccessToken struct {
	ClientID     string
	AccessToken  *adal.Token
	IsCloudShell bool
}

type AzureCLIProfile

type AzureCLIProfile struct {
	cli.Profile
}

func (AzureCLIProfile) FindDefaultSubscriptionId

func (a AzureCLIProfile) FindDefaultSubscriptionId() (string, error)

func (AzureCLIProfile) FindSubscription

func (a AzureCLIProfile) FindSubscription(subscriptionId string) (*cli.Subscription, error)

type Config

type Config struct {

	// Core
	ClientID                  string
	SubscriptionID            string
	TenantID                  string
	Environment               string
	SkipCredentialsValidation bool
	SkipProviderRegistration  bool

	// Service Principal Auth
	ClientSecret string

	// Bearer Auth
	AccessToken  *adal.Token
	IsCloudShell bool
	UseMsi       bool
	MsiEndpoint  string
}

Config is the configuration structure used to instantiate a new Azure management client.

func (*Config) LoadTokensFromAzureCLI

func (c *Config) LoadTokensFromAzureCLI() error

LoadTokensFromAzureCLI loads the access tokens and subscription/tenant ID's from the Azure CLI metadata if it's not provided NOTE: this'll become an internal-only method in the near future

func (*Config) Validate added in v1.18.0

func (c *Config) Validate() error

Validate ensures that the current set of credentials provided are valid for the selected authentication type (e.g. Client Secret, Azure CLI, MSI etc.)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL