Logging in as a consumer to the Developer Portal by using the CLI

Use the toolkit CLI to log in to the Developer Portal as a consumer.

Before you begin

To log in as a consumer, you must have created a developer account in the Developer Portal as explained in the following tutorial: Tutorial: Creating Accounts and Applications on the Developer Portal.

About this task

You can use the toolkit CLI to log in to the Developer Portal as a consumer to view it and test how it behaves for your customers.

Procedure

  1. Set up the toolkit as explained in Installing the toolkit.
  2. Determine the name of your identity provider.

    When you log in from the CLI, you must provide the name of the realm (identity provider) that hosts your API Connect user account. If you don't know the name of your account's realm, you can look it up by using the following command.

    In the CLI, run the following command to see a list of all available identity providers (you do not need to be logged in to use this command):

    apic identity-providers:list --server consumer_endpoint_api --mode consumer --catalog catalog_name_or_id --org <provider_org_name_or_id> --fields registry_type,realm
    Where:
    • consumer_endpoint_api is the endpoint of the consumer API.
    • catalog_name_or_id is the name or ID of your catalog.
    • <provider_org_name_or_id> is the name of ID of your provider organization.
    For example:
    apic identity-providers:list -s consumer.abce-ci-15608-master.abce.ibm.com -m consumer -c sandbox -o org --fields registry_type,realm 
    total_results: 1
    results:
      - registry_type: 'lur'
        realm: 'consumer:4da2f1b9-05c1-4506-9e2d-951198d19ad3:faa5577d-625c-4fc8-8d19-26077c8aff95/sandbox-idp'
    In the response, the realm consists of the following elements:
    consumer:<provider_org_name_or_id>:<catalog_name_or_id>/<catalog_identity_provider_name>
    For example, consumer:myorg:mycatalog/sandbox-idp.

    Note that <catalog_identity_provider_name> is typically made up of catalog_name-idp, for example sandbox-idp.

  3. In the toolkit CLI, run the following command to log in to the Developer Portal:

    Command syntax:

    apic login --mode consumer --server consumer_endpoint_api --username username --password password --realm realm
    
    Where:
    • consumer_endpoint_api is the endpoint of the consumer API.
    • username is your API Connect username.
    • password is the password that corresponds to your API Connect username.
    • realm is the user registry realm for the specified <username>.

    Example:

    apic login --mode consumer --server consumer.9a6e-88fa49bc.eu-gb.apiconnect.cloud.ibm.com -u my_username -p Blue123 -r consumer:frankenstein:om-portal/portal-idp
    
    Logged into consumer.9a6e-88fb51bc.eu-gb.apiconnect.cloud.ibm.com successfully