File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ // Copyright (c) Microsoft Corporation. All rights reserved.
2+ // Licensed under the MIT License. See LICENSE in the project root for license information.
3+
4+ package cache_test
5+
6+ import (
7+ "github.com/AzureAD/microsoft-authentication-extensions-for-go/extensions/accessor/file"
8+ "github.com/AzureAD/microsoft-authentication-extensions-for-go/extensions/cache"
9+ "github.com/AzureAD/microsoft-authentication-library-for-go/apps/public"
10+ )
11+
12+ // This example shows how to configure an MSAL public client to store data in a persistent cache.
13+ func Example () {
14+ path := "path to cache file"
15+ a , err := file .New (path )
16+ if err != nil {
17+ // TODO: handle error
18+ }
19+ c , err := cache .New (a , path )
20+ if err != nil {
21+ // TODO: handle error
22+ }
23+ app , err := public .New ("client-id" , public .WithCache (c ))
24+ if err != nil {
25+ // TODO: handle error
26+ }
27+
28+ _ = app
29+ }
You can’t perform that action at this time.
0 commit comments