Skip to content

Commit a1d18bb

Browse files
committed
Merge branch 'master' of github.com:mindsphere/mindsphere-auth-helper
2 parents 6650857 + 299086d commit a1d18bb

File tree

3 files changed

+40
-9
lines changed

3 files changed

+40
-9
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
## 1.0.2 August 2020
4+
5+
- released to chrome store
6+
7+
## 1.0.1 August 2020
8+
- vendorded all dependencies
9+
10+
## 1.0.0 July 2020
11+
- initial version

README.md

+25-5
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,40 @@
44

55
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.
66

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+
713
![screenshot](images/screenshot.extension.png)
814

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
1019

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+
```
1226

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.
1432

1533
![cli](images/cookieresult.png)
1634

17-
## MindSphere Development Proxy
35+
## Using the cookies with MindSphere Development Proxy
1836

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).
2038

2139
![cli](images/proxy-cookie.png)
2240

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+
2343
**Important: Treat the authentication cookies like your credentials and use them only in secure environments.**

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)