File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-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.
3+
4+ package managedidentity_test
5+
6+ import (
7+ mi "github.com/AzureAD/microsoft-authentication-library-for-go/apps/managedidentity"
8+ )
9+
10+ func ExampleNew () {
11+ // System assigned Client
12+ miSystemassignedClient , err := mi .New (mi .SystemAssigned ())
13+ if err != nil {
14+ // TODO: Handle error
15+ }
16+ _ = miSystemassignedClient
17+
18+ // User assigned Client
19+ clientId := "ClientId" // TODO: replace with your Managed Identity Id
20+
21+ miClientIdAssignedClient , err := mi .New (mi .UserAssignedClientID (clientId ), mi .WithClientCapabilities ([]string {"cp1" }))
22+ if err != nil {
23+ // TODO: Handle error
24+ }
25+ _ = miClientIdAssignedClient
26+ }
You can’t perform that action at this time.
0 commit comments