Developer Documentation
  • Documentation Overview
  • Development Introduction
  • Getting Started
  • Fundamentals
    • Deploy an App via Pre-defined Sidecar
      • Sidecar Tutorial: Server-side
      • Sidecar Tutorial: Client-side
      • Sidecar Tutorial: Docker & Deploy
    • Deploy an App with Eureka
    • Design Guidance
  • Authentication
    • Accessing data exposed by the platform
    • Single Sign-On
      • Angular
      • Vue
      • Java Spring: Accepting JWT
      • Python Django: Accepting JWT
    • User and Role Identification
  • APIs | Data Integration
    • Submodel Index
    • Masterdata
    • Transactional data
  • Docker Information
    • Ruby Stack
    • Golang Stack
    • Node JS Stack
    • Java Spring Stack
    • Python Stack
  • Connect to the Platform
    • Integrate using Eureka Rest APIs
    • Use our Pre-built sidecar
    • Production deployment
  • Add-on Features
    • IApps-Navigation
  • Testing
  • FAQs | Troubleshooting
  • Registration
    • Application pre-requisites
      • Basic Requirements
    • Register Developer Account
    • Submit basic application info
    • Onboard Application
      • Submit Appstore details
        • App basic information
      • Configure Application
        • App Permission
        • App Data
        • AAS Instance
        • Licensing
        • Access Rights
        • Account Info
        • Terms Of Use
        • Pricing
      • Publish and test
        • Deploy
        • Register into Service Discovery
    • Publish to Marketplace
  • User Experience
  • The business model - How do I get paid?
  • References
    • IndustryApps - Intro
    • What is an Asset Administration Shell?
    • What is ECLASS?
      • How is ECLASS and Concept dictionary are used
    • Industry 4.0 standards
    • Customer Terms of Use
      • Subscription Order
    • Solution provider Terms of Use
      • Contract regions
      • Submission Form ( Solution provider)
Powered by GitBook
On this page
  1. Authentication

Accessing data exposed by the platform

You can access the data exposed by the platform through the IndustryApps AAS Gateway, which has REST endpoints provided by the IndustryApps Platform. You will get an AppID and AppSecretCode when you register your application to IndustryApps in the Solution Provider portal. These credentials can be used to create an AccessToken . This AccessToken needs to be sent with every request of API. Along with this, you need to provide theUserTokenwhich you will get from the below integration.

Platform javascript API

import platform-api.js into main file (index.html) and invoke getPlatformContext() method. It will return an object with params:

  • auth_token

  • euser

  • plant_selected

  • language_selected

  • plant_list

  • company_code

  • roles

index.html
<script src="https://cdn.uat.industryapps.net/cdn/js/v1/platform-api.js" type="text/javascript"></script>
// Example in Vue js
export default {
    head: {
        script: [
            { hid: 'getPlatformContext', 
            src: 'https://cdn.uat.industryapps.net/cdn/js/v1/platform-api.js', 
            defer: true }
        ]
    }
}

API documentation

Methods

getPlatformContext() → {Object} This function returns an object with params auth_token, euser, plant_selected, language_selected, plant_list, company_code, roles.

Returns: platformContext Type:

-Object
// Call getPlatformContext() after adding the CDN script.
const userData = getPlatformContext();
// e.g. auth_token callable at: userData.auth_token

Type Definitions

Name
Type
Description

auth_token

string

Token to be used in the header of every service call (UserToken)

euser

string

User code of logged in user

language_selected

string

Language code of selected language, default is 'en'

plant_selected

string

Id of selected plant

plant_list

object array

plant list

company_code

string

Current company code

roles

string array

User roles

Sample Response

{
    "auth_token": "eb837c91-bee4-4011-8af5-1f7af649be92",
    "euser": "heera@xeiex.com",
    "plant_selected": "1",
    "language_selected": "en",
    "plant_list": [
        {
            "plantId": 2,
            "plantName": "Kilsyth",
            "plantCode": "5698",
            "defaultPlant": false
        },
        {
            "plantId": 1,
            "plantName": "Brisbane 01",
            "plantCode": "0987",
            "defaultPlant": true
        }
    ],
    "company_code": "1234",
    "roles": [
        "GRP_M_ADD",
        "TOOL_CRD_VIEW",
        "SOP_A_VIEW",
        "TSOP_M_ADD",
        "QSOP_IU_DEL",
        "OPR_ACT_ADD",
        "VENDOR_M_EDIT",
        "PROC_TYP_M_DEL",
        "QSOP_V_VIEW",
        "COM_M_EDIT",
        "DTC_EDIT",
        "8e08d9_Add_VIEW",
        "MACH_M_EDIT",
        "SOP_M_ADD",
        "QC_VIEW"
    ]
}
PreviousAuthenticationNextSingle Sign-On

Last updated 2 years ago