IBM Support

How to register an app with API Connect cloud to consume API Connect consumer APIs

How To


Summary

This article describes how to register an app with API Connect cloud to consume API Connect consumer APIs.

Objective

Register a client app with API Connect Cloud.

Steps

Prerequisites:
  1. API Connect toolkit is installed. 
  2. You should have cloud admin level access to register a client app with the API Connect Cloud.
Register client app with API Connect Cloud
In order to perform this tutorial, you should be cloud admin user. You must first log in to the API Connect server using the apic login command. You will need the realm in which your account  exists. The realm corresponds to the user registry (identity provider) in which the user credentials are held.
Step 1.  Find the name of identity provider (user registry).
Using following command you can list the set of identity providers (user registries) with the 'admin' scope in the system. 
apic identity-providers:list --scope admin --server <<your mgmt server>>
img2
You need to find the name of identity provider (user registry) where your account is held.  For example, my account is held in the 'BluePages' registry and the name of that registry is 'bluepages'. My realm value will therefore be 'admin/bluepages'.
Step 2.  Login to API Connect management server via CLI.
You can login in via below command in one step or you can use interactive login by issuing the "apic login" command at the command prompt and supply values as required.
apic login --server <<your server mgmt server>>  --username <<user-id>> --password <<password>> --realm admin/<<your-idp-name>>
img2
Step 3. Create a JSON file in your current working directory that provides the parameters to register an app. Below is a sample json file.
file: app1.json
{
  "name": "demo-restapi-consumertoolkit-client-app2",
  "client_id": "demo-restapi-consumertoolkit-client-app2", 
  "client_secret": "secret",
  "client_type": "consumer_toolkit"
}
image 2418
image 2434
Step 4. Create app registration
Issue the command as shown below to register an app.

apic registrations:create --format json --server <<your-mgmt-server>>  <<your-json-file>>
Below is the output of the command when running with sample file app1.json shown in this article.
image 2435
You are done with the app registration. Note down the app name, client id and secret. 
Step 5. Logout from the CLI session.
Using the command as below you can log out from the CLI session.

apic logout --server <<your-mgmt-server>> 
image 6

Document Location

Worldwide

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSMNED","label":"IBM API Connect"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"v2018","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
26 February 2020

UID

ibm13458397