I have currently have 2 Box Enterprise accounts that I would like to be able to access with JWT auth from a single App.
For example, I have Enterprise ID 1234 and Enteprise ID 5678. The app was created under 1234, and was given access to 5678 through the admin portal. When using the UserClient, I am able to retrieve files for users in either enterprise account. However, using the AdminClient, I am not able to specify the enterprise to use, and it defaults to 1234.
I assume I need to do this when I create the token, but don't see where, and I was unable to find this in the documentation. I am creating the AdminClient like so:
private BoxClient CreateNewAdminClient()
{
var client = GetJWTAuth().AdminClient(GetToken());
return client;
}
private string GetToken()
{
var token = GetJWTAuth().AdminToken();
return token;
}
private BoxJWTAuth GetJWTAuth()
{
IBoxConfig config = ConfigureBoxApi();
return new BoxJWTAuth(config);
}
private static IBoxConfig ConfigureBoxApi()
{
IBoxConfig config = null;
using (FileStream fs = new FileStream(@"config.json", FileMode.Open))
{
config = BoxConfig.CreateFromJsonFile(fs);
}
return config;
}