aad

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type JWTProviderOption

type JWTProviderOption func(provider *TokenProviderConfiguration) error

JWTProviderOption provides configuration options for constructing AAD Token Providers

func JWTProviderWithAADToken

func JWTProviderWithAADToken(aadToken *adal.ServicePrincipalToken) JWTProviderOption

JWTProviderWithAADToken configures the token provider to use a specific Azure Active Directory Service Principal token

func JWTProviderWithAzureEnvironment

func JWTProviderWithAzureEnvironment(env *azure.Environment) JWTProviderOption

JWTProviderWithAzureEnvironment configures the token provider to use a specific Azure Environment

func JWTProviderWithClientCertificate

func JWTProviderWithClientCertificate(clientID, certificatePath, certificatePassword, tenantID, environment string) JWTProviderOption

JWTProviderWithClientCertificate configures the TokenProvider with client certificate - attempt to authenticate with a Service Principal via tenantID, clientID, certificatePath, and certificatePassword

func JWTProviderWithClientCredentials

func JWTProviderWithClientCredentials(clientID, clientSecret, tenantID, environment string) JWTProviderOption

JWTProviderWithVars configures the TokenProvider with client credentials - attempt to authenticate with a Service Principal via tenantID, clientID and clientSecret

func JWTProviderWithManagedIdentity

func JWTProviderWithManagedIdentity(clientID, environment string) JWTProviderOption

JWTProviderWithManagedIdentity configures the TokenProvider using managed identity

  • attempt to authenticate using managed identity. If clientID is supplied then it will use that as the clientID of the user assigned managed identity. Otherwise it will default to the system assigned managed identity

Deprecated use JWTProviderWithManagedIdentityClientID

func JWTProviderWithManagedIdentityClientID

func JWTProviderWithManagedIdentityClientID(clientID, environment string) JWTProviderOption

JWTProviderWithManagedIdentityClientID configures the TokenProvider using managed identity clientID

  • attempt to authenticate using managed identity clientID. Otherwise it will default to the system assigned managed identity

func JWTProviderWithManagedIdentityResourceID

func JWTProviderWithManagedIdentityResourceID(resourceID, environment string) JWTProviderOption

JWTProviderWithManagedIdentityResourceID configures the TokenProvider using managed identity

  • attempt to authenticate using managed identity resourceID. Otherwise it will default to the system assigned managed identity

func JWTProviderWithResourceURI

func JWTProviderWithResourceURI(resourceURI string) JWTProviderOption

JWTProviderWithResourceURI configures the token provider to use a specific eventhubResourceURI URI

type TokenProvider

type TokenProvider struct {
	// contains filtered or unexported fields
}

TokenProvider provides cbs.TokenProvider functionality for Azure Active Directory JWTs

func NewJWTProvider

func NewJWTProvider(opts ...JWTProviderOption) (*TokenProvider, error)

NewJWTProvider builds an Azure Active Directory claims-based security token provider

func (*TokenProvider) GetToken

func (t *TokenProvider) GetToken(audience string) (*auth.Token, error)

GetToken gets a CBS JWT

type TokenProviderConfiguration

type TokenProviderConfiguration struct {
	TenantID            string
	ClientID            string
	ResourceID          string
	ClientSecret        string
	CertificatePath     string
	CertificatePassword string
	ResourceURI         string

	Env *azure.Environment
	// contains filtered or unexported fields
}

TokenProviderConfiguration provides configuration parameters for building JWT AAD providers

func (*TokenProviderConfiguration) NewServicePrincipalToken

func (c *TokenProviderConfiguration) NewServicePrincipalToken() (*adal.ServicePrincipalToken, error)

NewServicePrincipalToken creates a new Azure Active Directory Service Principal token provider

Jump to

Keyboard shortcuts

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