Skip to content

Conversation

@chlowell
Copy link
Contributor

@chlowell chlowell commented May 3, 2023

These packages contain the public API for applications to configure a persistent cache, and an unencrypted file storage implementation (future PRs will have the encrypted implementations). Usage looks like this:

import (
	"github.com/AzureAD/microsoft-authentication-extensions-for-go/extensions/cache"
	"github.com/AzureAD/microsoft-authentication-extensions-for-go/extensions/cache/accessor/file"
	"github.com/AzureAD/microsoft-authentication-library-for-go/apps/public"
)

// create a storage accessor
a, err := file.New(path)
if err != nil {
	// TODO
}
// create a Cache to synchronize around that storage
c, err := cache.New(a, path)
if err != nil {
	// TODO
}
// configure an MSAL client to use the Cache
app, err := public.New(clientID, public.WithCache(c))
if err != nil {
	// TODO
}

@chlowell chlowell mentioned this pull request May 11, 2023
@chlowell chlowell marked this pull request as ready for review May 17, 2023 00:08
@chlowell chlowell mentioned this pull request May 18, 2023
@bgavrilMS
Copy link
Member

LGTM

Ideally we'd do a manual (auomated?) test with an app using MSAL.NET (or any other one) sharing a cache with an app using MSAL Go.

@chlowell chlowell linked an issue Jun 8, 2023 that may be closed by this pull request
@chlowell chlowell merged commit 7f96225 into dev Jun 8, 2023
@chlowell chlowell deleted the chlowell/cache branch June 8, 2023 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a Token Cache layer

4 participants