• <GetStart>
  • CSPro User's Guide
    • The CSPro System
    • Data Dictionary Module
    • The CSPro Language
    • Data Entry Module
    • Batch Editing Applications
    • Tabulation Applications
    • Data Sources
    • CSPro Statements and Functions
    • Text Templates
    • Templated Reporting System
    • HTML, Markdown, and JavaScript Integration
    • Action Invoker
      • Overview
      • Execution Environments
      • Security, Resource Management, and Formatting Options
      • Base Actions
        • execute Action
        • registerAccessToken Action
        • throwException Action
      • Application Namespace
      • Clipboard Namespace
      • Data Namespace
      • Dictionary Namespace
      • File Namespace
      • Hash Namespace
      • Localhost Namespace
      • Logic Namespace
      • Message Namespace
      • Path Namespace
      • Settings Namespace
      • Sqlite Namespace
      • System Namespace
      • UI Namespace
    • Appendix
  • <CSEntry>
  • <CSBatch>
  • <CSTab>
  • <DataManager>
  • <TextView>
  • <TblView>
  • <CSFreq>
  • <CSDeploy>
  • <CSPack>
  • <CSDiff>
  • <CSConcat>
  • <Excel2CSPro>
  • <CSExport>
  • <CSIndex>
  • <CSReFmt>
  • <CSSort>
  • <ParadataConcat>
  • <ParadataViewer>
  • <CSCode>
  • <CSDocument>
  • <CSView>
  • <CSWeb>

registerAccessToken Action

Format
CS.registerAccessToken(accessToken := ...)
ArgumentDescriptionTypes / Required
accessTokenThe access token.string
required
Description
The registerAccessToken action registers an access token, permitting access to the Action Invoker from external callers that use this access token. Registered access tokens are added to the list of permitted access tokens specified as part of an application's logic settings. Multiple access tokens can be registered to a single application.
This action can only be executed from trusted environments.
Return Value
The action returns undefined.
Exceptions
The action throws an exception if any of its arguments are not specified in a valid form, or if the action is executed from an environment that is not trusted.
Example (CSPro Logic)
// register the access token
CS.registerAccessToken(accessToken := "b082da4b-6a3b-4069-aa07-0a2dd6f0b715");
Example (HTML + JavaScript)
<script>
    // use the Action Invoker with the registered access token
    const CS = new CSProActionInvoker("b082da4b-6a3b-4069-aa07-0a2dd6f0b715");
</script>
See also: Action Invoker Overview, Action Invoker Access Tokens