|
4 | 4 |
|
5 | 5 | This chrome extension can be used to simplify the development tasks for which you need to use the [SESSION and XSRF-TOKEN](https://developer.mindsphere.io/howto/howto-local-development.html#generate-user-credentials) 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.
|
6 | 6 |
|
| 7 | +## Installation |
| 8 | + |
| 9 | +Go to <a href="https://chrome.google.com/webstore/detail/mindsphere-authentication/licndiiilobojikmhmmcgdbpmnmdeoee"><i class="fab fa-chrome"></i> chrome web store</a> and click on **add to chrome**. |
| 10 | + |
| 11 | +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. |
| 12 | + |
7 | 13 | 
|
8 | 14 |
|
9 |
| -## MindSphere CLI |
| 15 | +The cookies can be used with the tools like [curl](https://developer.mindsphere.io/howto/howto-local-development.html#curl-example), [postman](https://developer.mindsphere.io/howto/howto-local-development.html#postman-example_1) etc. (Click on the links for more examples) |
| 16 | + |
| 17 | +```bash |
| 18 | +#!/bin/bash |
10 | 19 |
|
11 |
| -The extension works also really well with the MindSphere CLI in the [Session Cookie - XSRF-Token Configuration](https://opensource.mindsphere.io/docs/mindconnect-nodejs/cli/setting-up-the-cli.html#tab1anchor3) |
| 20 | +curl -vv \ |
| 21 | + -G \ |
| 22 | + --cookie "SESSION=<session-copied-from=browser>;XSRF-TOKEN=<xsrf-copied-from-browser>" \ |
| 23 | + -X GET \ |
| 24 | + https://<tenantId>-<appId>-<tenantId>.<regionId>.mindsphere.io/api/assetmanagement/v3/assets |
| 25 | +``` |
12 | 26 |
|
13 |
| -Use the extension to copy the cookies to the clipboard, paste them to the command line (there is bash, Windows CMD and Windows Powershell support) and start using the [MindSphere CLI](https://opensource.mindsphere.io/docs/mindconnect-nodejs/cli/index.html) right away. |
| 27 | +## Using the cookies with MindSphere CLI |
| 28 | + |
| 29 | +The extension works really well with the MindSphere CLI in the [Session Cookie - XSRF-Token Configuration](https://opensource.mindsphere.io/docs/mindconnect-nodejs/cli/setting-up-the-cli.html#tab1anchor3) because the **Bash**, **PS**, and **CMD** buttons already copy the cookies in the required format for MindSphere CLI. |
| 30 | + |
| 31 | +Use the extension to copy the cookies to the clipboard, paste them to the command line and start using the [MindSphere CLI](https://opensource.mindsphere.io/docs/mindconnect-nodejs/cli/index.html) right away. |
14 | 32 |
|
15 | 33 | 
|
16 | 34 |
|
17 |
| -## MindSphere Development Proxy |
| 35 | +## Using the cookies with MindSphere Development Proxy |
18 | 36 |
|
19 |
| -You can also use the exentsion to simplify the start of [MindSphere Development Proxy](https://opensource.mindsphere.io/docs/mindconnect-nodejs/cli/development-proxy.html) in a similar fashion. Just copy/paste the cookies to the command line and [start the development proxy](https://opensource.mindsphere.io/docs/mindconnect-nodejs/cli/development-proxy.html#tab1anchor1). |
| 37 | +You can also use the extension to simplify the start of [MindSphere Development Proxy](https://opensource.mindsphere.io/docs/mindconnect-nodejs/cli/development-proxy.html) in a similar fashion. Just copy/paste the cookies to the command line and [start the development proxy](https://opensource.mindsphere.io/docs/mindconnect-nodejs/cli/development-proxy.html#tab1anchor1). |
20 | 38 |
|
21 | 39 | 
|
22 | 40 |
|
| 41 | +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. |
| 42 | + |
23 | 43 | **Important: Treat the authentication cookies like your credentials and use them only in secure environments.**
|
0 commit comments