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 ¶
- type AcquireTokenOption
- type AcquireTokenOptions
- type Client
- func New(id ID, options ...ClientOption) (Client, error)
- func (c Client) AcquireToken(ctx context.Context, resource string, options ...AcquireTokenOption) (base.AuthResult, error)
- type ClientOption
- func WithHTTPClient(httpClient ops.HTTPClient) ClientOption
- func WithRetryPolicyDisabled() ClientOption
- type ID
- type Source
- type UserAssignedClientID
- type UserAssignedObjectID
- type UserAssignedResourceID
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 (c 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(*Client)
func WithHTTPClient ¶
func WithHTTPClient(httpClient ops.HTTPClient) ClientOption
WithHTTPClient allows for a custom HTTP client to be set.
func WithRetryPolicyDisabled ¶
func WithRetryPolicyDisabled() ClientOption
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" AzureML Source = "AzureML" AppService Source = "AppService" )
func GetSource ¶
GetSource detects and returns the managed identity source available on the environment.
type UserAssignedClientID ¶
type UserAssignedClientID string
type UserAssignedObjectID ¶
type UserAssignedObjectID string
type UserAssignedResourceID ¶
type UserAssignedResourceID string
Source Files ¶
azure_ml.go cloud_shell.go managedidentity.go servicefabric.go
- Version
- v1.4.0
- Published
- Feb 14, 2025
- Platform
- js/wasm
- Imports
- 18 packages
- Last checked
- 2 weeks ago –
Tools for package owners.