as-user in dotnet
Hi,
I'm new to box.com.
I need to access programmatically the content of any user.
In the sample code below (c#), I don't see where / how to set the as-user information.
Is there any sample available in dotnet?
var privateKey = File.ReadAllText("key.pem");
var boxConfig = new BoxConfig(CLIENT_ID, CLIENT_SECRET, ENTERPRISE_ID, privateKey, JWT_PRIVATE_KEY_PASSWORD, JWT_PUBLIC_KEY_ID);
var boxJWT = new BoxJWTAuth(boxConfig);
var adminToken = boxJWT.AdminToken();
var adminClient = boxJWT.AdminClient(adminToken);
BoxCollection users = await adminClient.UsersManager.GetEnterpriseUsersAsync();
// Here we need to impersonate the user
Console.WriteLine("Admin root folder items");
var items = await adminClient.FoldersManager.GetFolderItemsAsync("0", 500);
Regards.
サインインしてコメントを残してください。
コメント
1件のコメント