Sample commands to register, list, fetch and delete OAuth2 API client(s) required to access public web service APIs.

Sample commands to register, list, fetch and delete OAuth2 API client(s) required to access public web service APIs.

book

Article ID: KB0070662

calendar_today

Updated On:

Products

Spotfire Server

Description

This article provides sample commands along with their output to register, list, fetch and delete OAuth2 API client(s) required to access public web service APIs.

Issue/Introduction

This article provides sample commands along with their output to register, list, fetch and delete OAuth2 API client(s). The reference documentation links are also provided.

Resolution

1. To register a new API client (register-api-client):
config register-api-client --name="TestAPIClientALL" -Sapi.soap.library-service -Sapi.soap.update-analysis-service 
-Sapi.soap.information-model-service -Sapi.soap.license-service -Sapi.soap.user-directory-service -Sapi.rest.automation-services-job.execute
Output from the above command:
Tool password:
Successfully registered a new API client with the display name 'TestAPIClientALL':
Client ID: 69904af1cd7297c6bc3503e62b01b0d5.oauth-clients.spotfire.tibco.com
Client secret: 53c19cc23d9182639747921eb6d96f779809e81c28f622844c3463dbbecef8da
To view the full client configuration, please use the 'show-oauth2-client' comma
nd.


2. To show the configuration of a specified OAuth2 client (show-oauth2-client).
 
config show-oauth2-client --client-id=69904af1cd7297c6bc3503e62b01b0d5.oauth-clients.spotfire.tibco.com
Output from the above command:
Tool password:
Showing the configuration for the OAuth2 client 'TestAPIClient':
       Creation date: 2019-03-13
       Type: Public API client
       Client ID: d88e8f0c0199d829885851c5546f30b2.oauth-clients.spotfire.tibco
.com
       Client secret: REDACTED
       Authorized scopes: api.soap.update-analysis-service, api.soap.informatio
n-model-service, api.soap.license-service, api.soap.user-directory-service, api.
soap.library-service


3. To list registered OAuth2 clients (list-oauth2-clients):
config list-oauth2-clients

Output from the above command:
Tool password:
OAuth2 clients:
Name              Creation date  Type               Profile  Client ID
----------------  -------------  -----------------  -------  -------------------
----------------------------------------------
TestAPIClient  2019-08-19     Public API client  Other    69904af1cd7297c6bc3
503e62b01b0d5.oauth-clients.spotfire.tibco.com
TestAPIClient2  2019-08-26     Public API client  Other    524fed3d08aded5cd8c
310b11262bfc6.oauth-clients.spotfire.tibco.com



4. To delete a specified OAuth2 client (delete-oauth2-client).
config delete-oauth2-client --client-id=524fed3d08aded5cd8c310b11262bfc6.oauth-clients.spotfire.tibco.com
Output from the above command:
Tool password:
Successfully deleted the OAuth2 client with ID '524fed3d08aded5cd8c310b11262bfc6
.oauth-clients.spotfire.tibco.com'

Additional Information

register-api-client:
https://docs.tibco.com/pub/spotfire_server/latest/doc/html/TIB_sfire_server_tsas_admin_help/server/topics/register-api-client.html

show-oauth2-client:
https://docs.tibco.com/pub/spotfire_server/latest/doc/html/TIB_sfire_server_tsas_admin_help/server/topics/show-oauth2-client.html

list-oauth2-clients:
https://docs.tibco.com/pub/spotfire_server/latest/doc/html/TIB_sfire_server_tsas_admin_help/server/topics/list-oauth2-clients.html

delete-oauth2-client:
https://docs.tibco.com/pub/spotfire_server/latest/doc/html/TIB_sfire_server_tsas_admin_help/server/topics/delete-oauth2-client.html