Documentation
¶
Overview ¶
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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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" )
type UserAssignedClientID ¶
type UserAssignedClientID string
type UserAssignedObjectID ¶
type UserAssignedObjectID string
type UserAssignedResourceID ¶
type UserAssignedResourceID string