You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the Box Developer Forums and my issue isn't already reported (or if it has been reported, I have attached a link to it, for reference).
I have installed CLI in my environment last month and configured environment with my json.config file (default).
When I check my install using box users:get - it returns the info for my service account user (and I generate token for that user.)
context: I use the CLI in my workflow to trigger JWT token.
NOW I wish to add a SECOND automation user and private key to get token with the SECOND automation user's credentials.
After following the directions:
$ box configure:environments:add PATH_TO_CONFIG_FILE --private-key-path PATH_TO_PRIVATE_KEY --name SecondKey
Successfully added CLI environment "SecondKey"
Steps to Reproduce
I have executed --name SecondKey in my environment
and then attempted to verify the installation of a second CLI environment --name SecondKey
by executing box users: get SecondKey
box tokens: get SecondKey
and nothing happens
Expected Behavior
I expected to return the user info for the SECOND automation user
when I execute box users:get it returns information from my first environment
Goal
I would like CLI to be able to use both environment regularly to produce tokens [box tokens:get] for each service account by adding some sort of flag to my box []: get commands
So you still get data of the first environment after adding the second one (for example, when calling box:users)? Did you switch the default environment to the second one after adding it? I see that this is not done by default. You can do it with the following command box configure:environments:set-current EnvironmentName
So you still get data of the first environment after adding the second one (for example, when calling box:users)? Did you switch the default environment to the second one after adding it? I see that this is not done by default. You can do it with the following command box configure:environments:set-current EnvironmentName
Thanks @mwwoda Yes I've updated my post to reflect that I still get info from my first environment.
###follow up question
Will I be able to use both environments sequentially regularly with only the box tokens:get --[flag for environment]
It's not possible right now, but we plan to implement some kind of --profile flag that can be passed to the command to temporarily use a different environment for a single request! This is already in our backlog (SDK-3342) and somehow related #498 . Unfortunately, I can't provide a timeline for this feature for now.
Yes it looks like #498 is requesting a similar flow.
So to confirm. At this point CLI can be be configured to a SINGLE environment?
This is my scenario:
I have two departments in the same corp - each have their own JWT service account.
I would like to be able use script box tokens:get --DeptA box tokens:get --DeptB after configuring environment to both these users DeptA and DeptB.
The CLI for each would be stored and triggered from a shared cloud location.
Is the above possible via CLI? If not do you have an alternate suggestion. I am only using CLI for JWT Token.
For now if you want to use diffrent box aps you should create two environments switch them after each call
Assuming that you have two environments with names DeptA and DeptB
You can confirm it by box configure:environments:get command
box configure:environments:set-current DeptA
box tokens:get (will get token for DeptA)
box configure:environments:set-current DeptB
box tokens:get (will get token for DeptB
and so on.
The --profile proposal would allow to do that without the constant switching, just by supplying additional flag in each call.
This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.
This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box CLI and feel free to open another PR/issue at any time.
Activity
mwwoda commentedon Sep 27, 2023
So you still get data of the first environment after adding the second one (for example, when calling box:users)? Did you switch the default environment to the second one after adding it? I see that this is not done by default. You can do it with the following command
box configure:environments:set-current EnvironmentNamePlantGirlCodes commentedon Sep 27, 2023
Thanks @mwwoda Yes I've updated my post to reflect that I still get info from my first environment.
###follow up question
Will I be able to use both environments sequentially regularly with only the box tokens:get --[flag for environment]
mwwoda commentedon Sep 28, 2023
It's not possible right now, but we plan to implement some kind of
--profileflag that can be passed to the command to temporarily use a different environment for a single request! This is already in our backlog (SDK-3342) and somehow related #498 . Unfortunately, I can't provide a timeline for this feature for now.PlantGirlCodes commentedon Sep 28, 2023
Yes it looks like #498 is requesting a similar flow.
So to confirm. At this point CLI can be be configured to a SINGLE environment?
This is my scenario:
Is the above possible via CLI? If not do you have an alternate suggestion. I am only using CLI for JWT Token.
mwwoda commentedon Sep 29, 2023
For now if you want to use diffrent box aps you should create two environments switch them after each call
Assuming that you have two environments with names DeptA and DeptB
You can confirm it by
box configure:environments:getcommandand so on.
The --profile proposal would allow to do that without the constant switching, just by supplying additional flag in each call.
stale commentedon Oct 29, 2023
This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.
stale commentedon Nov 5, 2023
This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box CLI and feel free to open another PR/issue at any time.