Enabling self service user and org creation in Pivotal Cloud Foundry

featured-pcfPivotal Cloud Foundry has a web page where users can goto and login and manage their environment.  Depending on the privileges assigned to the user this may mean the ability to invite other users, create orgs, create spaces, manage apps, etc.

PCF has a self-service ability to allow users to create their own accounts.  By default this it turned off.

For instance, my PCF domain is cf.lab.local.  I can access the user portal (Formerly referred to as the developer console or just console, but now referred to as apps_manager) at: https://login.cf.lab.local

Pivotal

The link shows to Create Account.  Clicking on it will give the following 403 Forbidden error:

Pivotal_CF

To allow for users to create accounts via self-service, you must set the environment variable ENABLE_NON_ADMIN_USER_MANAGEMENT, and additionally so that they can have their own org, you should enable ENABLE_NON_ADMIN_ORG_CREATION.

From a terminal window, run cf api URL and target your Apps Manager URL. For example:

nettles:~ bfeeny$ cf api api.cf.lab.local --skip-ssl-validation

Setting api endpoint to api.cf.lab.local...
OK

API endpoint:   https://api.cf.lab.local (API version: 2.23.0)   
Not logged in. Use 'cf login' to log in.

Run cf login and provide your UAA Administrator user credentials:

nettles:~ bfeeny$ cf login
API endpoint: https://api.cf.lab.local

Email> admin

Password> 
Authenticating...
OK

Select the system org and the console space:

Targeted org system

Select a space (or press enter to skip):
1. apps_manager
2. app-usage-service
3. autoscaling
4. notifications-with-ui

Space> 1
Targeted space apps_manager

API endpoint:   https://api.cf.lab.local (API version: 2.23.0)   
User:           admin   
Org:            system   
Space:          apps_manager   

Set the ENABLE_NON_ADMIN_ORG_CREATION environment variable to true:

nettles:~ bfeeny$ cf set-env apps_manager ENABLE_NON_ADMIN_USER_MANAGEMENT true
Setting env variable 'ENABLE_NON_ADMIN_USER_MANAGEMENT' to 'true' for app apps_manager in org system / space apps_manager as admin...
OK
TIP: Use 'cf restage' to ensure your env variable changes take effect

Set the ENABLE_NON_ADMIN_ORG_CREATION environment variable to true:

nettles:~ bfeeny$ cf set-env apps_manager ENABLE_NON_ADMIN_ORG_CREATION true
Setting env variable 'ENABLE_NON_ADMIN_ORG_CREATION' to 'true' for app apps_manager in org system / space apps_manager as admin...

OK
TIP: Use 'cf restage' to ensure your env variable changes take effect

Even though it says to run cf restage we can just do a cf restart:

nettles:~ bfeeny$ cf restart apps_manager
Stopping app apps_manager in org system / space apps_manager as admin...
OK

Starting app apps_manager in org system / space apps_manager as admin...

0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 starting
1 of 1 instances running

App started

OK

App apps_manager was started using this command bundle exec rake server:start_command --trace

Showing health and status for app apps_manager in org system / space apps_manager as admin...
OK

requested state: started
instances: 1/1
usage: 1G x 1 instances
urls: console.cf.lab.local
last uploaded: Fri Apr 17 00:21:01 UTC 2015

     state     since                    cpu    memory         disk           details   
#0   running   2015-04-16 10:38:25 PM   0.0%   209.3M of 1G   285.1M of 1G

Now that this environment variable is properly set we can goto the login page again:

Pivotal

And this time when we click Create Account we the page we would expect:

Pivotal_CF

We will add a user and click send and are given a positive result:

Pivotal_CF_and_bfeeny_—_tempest_pivotal-ops-manager____—_bash_—_198×47

And email should arrive which looks like below:

Inbox_—_Harvard_FAS_IMAP__75_messages_

Click on Verify your email address and you will be sent to a page to enter your password:

Pivotal_CF_and_Inbox_—_Harvard_FAS_IMAP__75_messages_

 

Once this is done, you now are asked to create an Org:

Pivotal_CF

Now finally you have access to your own version of Apps Manager, and can have an environment of your own:

Pivotal_CF_and_Inbox_—_Harvard_FAS_IMAP__75_messages_

This entry was posted in Cloud Foundry, Pivotal, Uncategorized and tagged . Bookmark the permalink.

Leave a Reply