Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// ClientID is the application's ID.
ClientID string
// PrivateKey contains the contents of an RSA private key or the
// contents of a PEM file that contains a private key. The provided
// private key is used to sign JWT assertions.
// PEM containers with a passphrase are not supported.
// Use the following command to convert a PKCS 12 file into a PEM.
//
// $ openssl pkcs12 -in key.p12 -out key.pem -nodes
//
PrivateKey []byte
// Certificate contains the (optionally PEM encoded) X509 certificate registered
// for the application with which you are authenticating.
Certificate []byte
// Scopes optionally specifies a list of requested permission scopes.
Scopes []string
// TokenURL is the token endpoint. Typically you can use the AzureADEndpoint
// function to obtain this value, but it may change for non-public clouds.
TokenURL string
// Expires optionally specifies how long the token is valid for.
Expires time.Duration
// Audience optionally specifies the intended audience of the
// request. If empty, the value of TokenURL is used as the
// intended audience.
Audience string
}
Config is the configuration for using client credentials flow with a client assertion.
For more information see: https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials
func (*Config) Client ¶
Client returns an HTTP client wrapping the context's HTTP transport and adding Authorization headers with tokens obtained from c.
The returned client and its Transport should not be modified.
func (*Config) TokenSource ¶
func (c *Config) TokenSource(ctx context.Context) oauth2.TokenSource
TokenSource returns a JWT TokenSource using the configuration in c and the HTTP client from the provided context.
Click to show internal directories.
Click to hide internal directories.