Registry / auth / azuread-microsoft-authentication-library-for-go

azuread-microsoft-authentication-library-for-go

JSON →
library1.7.2gogounverified

A library for authenticating users and acquiring tokens to access Microsoft APIs.

go get github.com/AzureAD/microsoft-authentication-library-for-go
INSTALL
IMPORT
SIG · AZUREAD-MICROSOFT-
A
azuread-microsoft-authentication-library-for-go
authgov1.7.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

msal
github.com/AzureAD/microsoft-authentication-library-for-go

Creates a public client app and acquires a token interactively.

package main import ( "context" "fmt" "log" "github.com/AzureAD/microsoft-authentication-library-for-go/apps/public" ) func main() { app, err := public.New("client-id", public.WithAuthority("https://login.microsoftonline.com/common")) if err != nil { log.Fatal(err) } result, err := app.AcquireTokenInteractive(context.Background(), []string{"User.Read"}) if err != nil { log.Fatal(err) } fmt.Printf("Access token: %s\n", result.AccessToken) }
Debug
Known issues
breakingBreaking changes between v0.x and v1.x
fix
Refer to migration guide when upgrading from older versions
affects: <1.0.0
Upgrade
Version history
1.7.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
27 hits · last 30 days
node
22
OpenAI (training)
1
Resources
azuread-microsoft-authentication-library-for-go — go get azuread-microsoft-authentication-library-for-go · libregistry