How to access PAPI Key to generate access token in ML untethered mode.

How to access PAPI Key to generate access token in ML untethered mode.

book

Article ID: KB0075007

calendar_today

Updated On:

Products Versions
TIBCO Cloud API Management - Local Edition ML 5.1 and above versions - Untethered mode

Description

Since ML 5.x untethered mode is completely cut off from the cloud, we will not be able to use Mashery API key in untethered cluster setup for making Mashery API calls like generating OAuth tokens for instance. Hence there is a replacement of Mashery API key in ML untethered set up called as PAPI key thats built as part of manifest directory once the tml cluster is created. Let see how to access the PAPI Key and where to access it from. 

Issue/Introduction

In this article, we will learn how to access the PAPI key for ML untethered mode which acts as a replacement for Mashery API Key in cloud/tethered mode.

Resolution

You can access the PAPI Key from under the script files from which you bring up the ML cluster. 

Got to the specific file location were you host the ML scripts and navigate to manifest folder. In this example i am using single zone deployment file so the path location would be : manifest-single-zone --> resources --> tml_papi_properties.json. 

PAPI Key and secret will be listed in the tml-papi_properties.json file as shown below along with many other fields like area uuid, customer area name etc. 

{

      "package_key_name": "your_api_key_for_v3_api",

      "package_key_value": "7wevdpn289e9v4****ndqu6c"

    }

{

      "package_secret_name": "your_secret_for_v3_api",

      "package_secret_value": "nbk27d***U"

    }

You can use this PAPI key value in the OAuth token flow for ML untethered mode: 

A sample call for create access token using the PAPI key is listed below: 

curl -u <PAPI Key>:<PAPI Secret>  -H "Host: api.<"sp_config_environment_domain_suffix value from papi properties file>  "http://localhost:7080/v3/token" -d "grant_type=password&username=admin&password=*****&scope=<area uuid>"