func newCachedInteractiveBrowserCredential()

in cmd/utils/auth.go [64:79]


func newCachedInteractiveBrowserCredential() (*cachedInteractiveBrowserCredential, error) {
	file := path.Join(config.Dir(), "token-cache.json")
	if err := os.MkdirAll(path.Dir(file), 0o700); err != nil {
		return nil, fmt.Errorf("creating cache directory: %w", err)
	}

	client, err := public.New(developerSignOnClientID,
		public.WithCache(&tokenCache{file: file}),
		public.WithAuthority(runtime.JoinPaths(cloud.AzurePublic.ActiveDirectoryAuthorityHost, organizationsTenantID)),
	)
	if err != nil {
		return nil, fmt.Errorf("creating public client: %w", err)
	}

	return &cachedInteractiveBrowserCredential{client: client}, nil
}