MindSphere Authentication Helper Chrome Extension
This chrome extension can be used to simplify the development tasks for which you need to use the SESSION and XSRF-TOKEN to access MindSphere APIs. It provides an easy way to copy the MindSphere authentication cookies to the clipboard without having to go to chrome developer tools.
Go to chrome web store and click on add to chrome.
Once the extension is installed: log in to your MindSphere tenant, navigate to your application and click on the extension icon to display the available application cookies. You can now click e.g. on session or Xsrf button which will copy the corresponding cookie to your clipboard.
#!/bin/bash curl -vv \ -G \ --cookie "SESSION=<session-copied-from=browser>;XSRF-TOKEN=<xsrf-copied-from-browser>" \ -X GET \ https://<tenantId>-<appId>-<tenantId>.<regionId>.mindsphere.io/api/assetmanagement/v3/assets
#!/bin/bash curl -v \ -X PUT https://<tenantId>-<appId>-<tenantId>.<regionId>.mindsphere.io/api/<puturl> \ --cookie "SESSION=<session-copied-from=browser>;XSRF-TOKEN=<xsrf-copied-from-browser>" \ --header "x-xsrf-token: <xsrf-copied-from-browser>" \ --header "Content-Type: application/json" \ --data-bin @<your data>
Using the cookies with MindSphere CLI
The extension works really well with the MindSphere CLI in the Session Cookie - XSRF-Token Configuration because the Bash, PS, and CMD buttons already copy the cookies in the required format for MindSphere CLI.
Use the extension to copy the cookies to the clipboard, paste them to the command line and start using the MindSphere CLI right away.
Using the cookies with MindSphere Development Proxy
This will start the development proxy with the credentials of the logged in users so that you can test the MindSphere authentication and authorization also in the local environment.
Important: Treat the authentication cookies like your credentials and use them only in secure environments.