msal

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package msal wraps Microsoft Authentication Library, providing transport for authenticated requests compatible with http.RoundTripper.

Index

Constants

View Source
const MicrosoftAuthority = "https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47"

MicrosoftAuthority is the authority for Microsoft accounts.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfidentialCredentialTransport

type ConfidentialCredentialTransport struct {
	Client confidential.Client
	Scopes []string

	// Transport is the underlying HTTP transport to use when making requests.
	// It will default to http.DefaultTransport if nil.
	Transport http.RoundTripper
}

ConfidentialCredentialTransport is an http.RoundTripper that makes requests with the "Authorization Bearer" header set to the token acquired from the confidential client.

func NewConfidentialTransportFromAzureKeyVaultJSON added in v0.0.2

func NewConfidentialTransportFromAzureKeyVaultJSON(authority, clientID string, vaultJSON []byte) (*ConfidentialCredentialTransport, error)

NewConfidentialTransportFromAzureKeyVaultJSON creates a new ConfidentialCredentialTransport.

authority is the URL of a token authority such as "https://login.microsoftonline.com/<your tenant>".

vaultJSON is the JSON content of a certificate stored in Azure Key Vault, as returned by 'az keyvault secret show'. It should be a JSON object with a property 'value' that contains a base64-encoded PFX-encoded certificate with private key.

func NewConfidentialTransportFromSecret added in v0.0.2

func NewConfidentialTransportFromSecret(authority, clientID, clientSecret string) (*ConfidentialCredentialTransport, error)

NewConfidentialTransportFromSecret creates a new ConfidentialCredentialTransport. authority is the URL of a token authority such as "https://login.microsoftonline.com/<your tenant>".

func (*ConfidentialCredentialTransport) RoundTrip

RoundTrip implements the RoundTripper interface.

Jump to

Keyboard shortcuts

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