Registry /
auth / azuread-microsoft-authentication-library-for-go
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)
}
Upgrade
Version history
1.7.2latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.