How do I manage org and space users in bluemix usi

2019-07-10 06:26发布

问题:

Bluemix provides a CF command line for download to manage applications.

We want to use CF (or any other command line tools ) to manage Organization and Space users. This will allow us to programmatically sync the user list.

Specifically I am looking for cf enroll-user cf add-user cf remove-user cf unenroll-use

the cf command already lists the users for a given ORG and SPACE.

回答1:

The simple answer is to read the docs. See "Creating and Managing Users with the cf CLI." It documents commands like create-user, set-org-role, and set-space-role.

For example: Use cf create-user USERNAME PASSWORD to create a new user. The problem is, when you try to do this in Bluemix, you get an error:

>cf create-user jdoe password
Creating user jdoe as bwoolf...
FAILED
Error creating user jdoe.
Server error, status code: 403, error code: access_denied, message: Invalid token does not contain resource id (scim)

You get a similar error when you try to run set-org-role or set-space-role:

FAILED
Server error, status code: 403: Access is denied.  You do not have privileges to execute this command.

Why did you get this error? Like @RandalAnders explained, Bluemix currently blocks users from using these user administration commands in the CF CLI. For the time being, you'll need to perform these actions using the Bluemix Dashboard.



回答2:

Currently, it is not possible within Bluemix to use the CF CLI for certain management commands, as they require administrative privileges. We are exploring expanding the scope of the commands used in the CLI and would be interested in hearing any other use cases you may have.



回答3:

you can not create a user on bluemix using cf cli since it needs admin privileges. To add a user, you will need to use bluemix cli 'bluemix iam account-user-invite' to invite a user to your account with a org/space role assigned. There are other account/org/space/role management commands under 'bluemix iam'.

Download bluemix CLI here: http://clis.ng.bluemix.net



标签: ibm-cloud