IronPython Script to display the Spotfire Username against Spotfire Cloud Environment returns a garbled string

IronPython Script to display the Spotfire Username against Spotfire Cloud Environment returns a garbled string

book

Article ID: KB0080019

calendar_today

Updated On:

Products Versions
TIBCO Cloud Spotfire -

Description

When we run the below IronPython Script in the Spotfire, it is expected to return the logged in user's name.
 from System import Environment, Threading  username = Threading.Thread.CurrentPrincipal.Identity.Name  Document.Properties["username3"] = username
However, If we run this same script against the Spotfire Cloud environment then, it will not return the desired username, instead it return a garbled string as is shown below:
Garbled string returned from IronPython Script

The reason for this is
  1. The authentication which is used in TIBCO Spotfire Cloud is that of Web Authentication (OpenID Connect) and hence you see this behavior (garbled characters being returned for logged in user name). It is actually the client ID (public identifier) that is  returned.
  2. When you log into Spotfire with the userid which is the email id (from the web) it is internally mapped with the Client ID.
  3. When we run this script, it is therefore fetching the public Identifier(client ID) which is a garbled string as you can see.  
Client ID as can be seen in the screenshot below:
ClientID
 

Issue/Introduction

IronPython Script to display the Spotfire Username against Spotfire Cloud Environment returns a garbled string

Environment

All Supported OS

Additional Information


 

Attachments

IronPython Script to display the Spotfire Username against Spotfire Cloud Environment returns a garbled string get_app