Signing up to the Developer Portal (local user registry)

If your Catalog is using a local user registry to authenticate user log in to the Developer Portal, you can use Developer Portal REST API calls to sign users up.

To complete the steps described in this topic, you need an environment capable of sending HTTP requests and receiving HTTP responses. Here, the curl command is used in a command line interface to demonstrate the REST API calls. In your environment, make the same REST API calls as are made with curl commands in this topic.

To sign a user up to the Developer Portal, you complete the following steps (detailed instructions are provided in the sections that follow):
  1. Request to sign up. Make one or other of the following REST API calls:
    • Request user self sign up to the Developer Portal and provide basic account information. A new Developer organization is created with the user as its owner.
    • Invite the user to join an existing Developer organization.

    On successful completion of the call, an activation email is sent to the user, and the account is in a pending state until the activation is completed.

  2. Obtain the user authentication information and activation URL. The activation email contains authentication information in base64 encoded form. You must base64 decode this authentication information.
  3. Activate the user account. Make a REST API call to activate the account, supplying the decoded authentication information.

Requesting to sign up to the Developer Portal

A user sign up request can be initiated either by self sign up or by invitation to join a Developer organization, as follows:

  • To initiate a self sign up request, make the following REST API call:
    curl -k -v -H "X-IBM-APIManagement-Context: provider_org.catalog" -H "Content-Type: application/json" -X POST -d \
    '{"username":"email_address","password":"password","firstName":"first_name","lastName":"last_name","organization":"dev_org_name"}' \
    https://management_service_address/v1/portal/users/register
    where:
    • provider_org is the name of the provider organization of the Developer Portal to which the user is to be signed up.
    • catalog is the name of the Catalog of the Developer Portal to which the user is to be signed up.
    • email_address is the email address of the user that you want to sign up. The email address is the user ID with which the user will log in to the Developer Portal.
    • password is the initial login password. The password must contain characters from three of the following four categories: uppercase, lowercase, numeric, and punctuation (for example, !, $, #, %).
    • first_name is the user's first name.
    • last_name is the user's last name.
    • dev_org_name is the name that will be assigned to the user's Developer organization.
    • management_service_address is the host name or IP address of your API Connect Management service.
  • To invite a user to join a Developer organization, make the following REST API call:
    curl -k -v -u "dev_org_owner_id:dev_org_owner_password" \
    -H "X-IBM-APIManagement-Context: provider_org.catalog" -H "Content-Type: application/json" \
    -X POST -d '{"name":"email_address", "roles":[array_of_roles]}' \
    https://management_service_address/v1/portal/orgs/dev_org_id/members
    where:
    • dev_org_owner_id is the login ID of the owner of the Developer organization that the user is being invited to join.
    • dev_org_owner_password is the login password of the owner of the Developer organization that the user is being invited to join.
    • provider_org is the name of the provider organization of the Developer Portal to which the user is to be signed up.
    • catalog is the name of the Catalog of the Developer Portal to which the user is to be signed up.
    • email_address is the email address of the user that you want to invite.
    • (optional) array_of_roles is a JSON array specifying the roles that you want to assign to the user. The following roles are available:
      • "developer": Can create and edit applications, manage client keys and subscribe to Plans.
      • "viewer": Can only view applications and application activity.
      For example:
      "roles":["developer"]
      If omitted, the default value is ["developer"].
    • management_service_address is the host name or IP address of your API Connect Management service.
    • dev_org_id is the ID of the Developer organization.
      To obtain the ID of the Developer organization, make the following REST API call, which lists the details of the Developer organizations of which the authenticated user is a member:
      curl -k -v -u "dev_org_user_id:dev_org_password" \
      -H "X-IBM-APIManagement-Context: provider_org.catalog" \
      -H 'Content-Type: application/json' -X GET https://management_service_address/v1/portal/orgs

After the sign up request is submitted, an activation email is sent to the specified email address.

Obtaining the user authentication information and activation REST API URL

The invitation email contains an activation link URL with an activationToken parameter. The activation link has the following format:
https://portal_url/?q=ibm_apim/activate/x&activationToken=activation_token

To obtain the user authentication information and the activation REST API URL, you must decode the activation token by using a base64 decoder.

The following example shows the format of the decoded activation token:
{"url":"https://myhost.com/v1/portal/users/48663d86e4b0e688ee1cded4/activate",
"username":"!BASE64_SIV_ENC!_AQZ+4GefJbUFPRVVbZb4M/fGgkeyHi9zZT4I8RKA3+IRAAAAGKc0NUo0lvPq2VxBHalDyYRHKdbQWoCs3dkCf43e9WoQ",
"authentication":{"username":"58651bdfe4b0e687ee1cc7a1/58651d9ce5b0e687ee1cc6b0/jS2lD1fW8nQ8zW0dE3cS6eI3hU1hP5oN3jU8dK7sP8",
"password":"CG+YUlm1cLITToGCfciSeVMdFeV7BQMxvsR0XxZbkc"},
"providerContext":{"orgID":"5819e9e6e4b0e645ee1bfdeb","environmentID":"58651bdfe4b0e687ee1cc7a1"}}
In the decoded token, the authentication field contains the authentication data in the following format:
"authentication":{"username":"encoded_user_name","password":"encoded_password"}
The url field contains the activation REST API URL in the following format:
"url":"activation_url"
The activation REST API URL has the following format:
https://management_service_address/v1/portal/users/user_id/activate
where:
  • management_service_address is the host name or IP address of your API Connect Management service.
  • user_id is a unique user ID string.

Note the encoded_user_name, encoded_password, and activation_url values because they are required in the REST API call that you use to activate the user account.

Activating the user account

Make the following REST API call:
curl -k -v -H "Content-Type: application/json" -H "X-IBM-APIManagement-Context: provider_org.catalog" \
-u 'encoded_user_name:encoded_password' -X POST -d \
'{"password":"password","firstName":"first_name","lastName":"last_name"}' activation_url
where:
  • provider_org is the name of the provider organization.
  • catalog is the name of the Catalog.
  • encoded_user_name and encoded_password are the authentication information values that you noted in Obtaining the user authentication information and activation REST API URL.
  • activation_url is the activation REST API URL that you noted in Obtaining the user authentication information and activation REST API URL.
  • password is the login password. The password must contain characters from three of the following four categories: uppercase, lowercase, numeric, and punctuation; for example, !, $, #, % (required only if the user was invited to join a Developer organization.)
  • first_name is the user's first name (required only if the user was invited to join a Developer organization.)
  • last_name is the user's last name (required only if the user was invited to join a Developer organization.)

On successful completion of the activation REST API call, the user can log in to the Developer Portal user interface, with their email address as the user ID.