package managedidentity

import "github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity"

Package managedidentity provides a client for retrieval of Managed Identity applications. The Managed Identity Client is used to acquire a token for managed identity assigned to an azure resource such as Azure function, app service, virtual machine, etc. to acquire a token without using credentials.

Index

Types

type AcquireTokenOption

type AcquireTokenOption func(o *AcquireTokenOptions)

func WithClaims

func WithClaims(claims string) AcquireTokenOption

WithClaims sets additional claims to request for the token, such as those required by token revocation or conditional access policies. Use this option when Azure AD returned a claims challenge for a prior request. The argument must be decoded.

type AcquireTokenOptions

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

type Client

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

func New

func New(id ID, options ...ClientOption) (Client, error)

Client to be used to acquire tokens for managed identity. ID: SystemAssigned, UserAssignedClientID, UserAssignedResourceID, UserAssignedObjectID

Options: WithHTTPClient

func (Client) AcquireToken

func (client Client) AcquireToken(ctx context.Context, resource string, options ...AcquireTokenOption) (base.AuthResult, error)

Acquires tokens from the configured managed identity on an azure resource.

Resource: scopes application is requesting access to Options: WithClaims

type ClientOption

type ClientOption func(o *ClientOptions)

func WithHTTPClient

func WithHTTPClient(httpClient ops.HTTPClient) ClientOption

WithHTTPClient allows for a custom HTTP client to be set.

type ClientOptions

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

type ID

type ID interface {
	// contains filtered or unexported methods
}

func SystemAssigned

func SystemAssigned() ID

type Source

type Source string
const (
	// DefaultToIMDS indicates that the source is defaulted to IMDS when no environment variables are set.
	DefaultToIMDS Source = "DefaultToIMDS"
	AzureArc      Source = "AzureArc"
	ServiceFabric Source = "ServiceFabric"
	CloudShell    Source = "CloudShell"
	AppService    Source = "AppService"
)

type UserAssignedClientID

type UserAssignedClientID string

type UserAssignedObjectID

type UserAssignedObjectID string

type UserAssignedResourceID

type UserAssignedResourceID string

Source Files

managedidentity.go

Version
v1.4.0-prerelease
Published
Nov 8, 2024
Platform
js/wasm
Imports
14 packages
Last checked
2 weeks ago

Tools for package owners.