Skip to content

Commit 97114a5

Browse files
danittHuachao
andauthored
Feature: AWS Cognito support (#1097)
* add Cognito support * fix unnecessary formatting * more unnecessary formatting * Update package.json * Update awsCognito.ts * update package-lock.json * Update awsCognito.ts * Update package-lock.json * fix ts-lint error --------- Co-authored-by: Huachao Mao <[email protected]>
1 parent c023cac commit 97114a5

File tree

5 files changed

+15154
-1877
lines changed

5 files changed

+15154
-1877
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ REST Client allows you to send HTTP request and view the response in Visual Stud
2323
- Azure Active Directory
2424
- Microsoft Identity Platform
2525
- AWS Signature v4
26+
- AWS Cognito
2627
* Environments and custom/system variables support
2728
- Use variables in any place of request(_URL_, _Headers_, _Body_)
2829
- Support __environment__, __file__, __request__ and __prompt__ custom variables
@@ -381,6 +382,19 @@ GET https://httpbin.org/aws-auth HTTP/1.1
381382
Authorization: AWS <accessId> <accessKey> [token:<sessionToken>] [region:<regionName>] [service:<serviceName>]
382383
```
383384

385+
### AWS Cognito
386+
To authenticate via AWS Cognito, you need to set the Authorization header schema to `COGNITO` and provide your AWS credentials separated by spaces:
387+
- `<Username>`: AWS Username for target user
388+
- `<Password>`: AWS Password for target user
389+
- `<Region>`: AWS Region for Cognito pool
390+
- `<UserPoolId>`: AWS Cognito User Pool ID
391+
- `<ClientId>`: AWS Cognito Client ID
392+
393+
```http
394+
GET https://httpbin.org/aws-auth HTTP/1.1
395+
Authorization: COGNITO <Username> <Password> <Region> <UserPoolId> <ClientId>
396+
```
397+
384398
## Generate Code Snippet
385399
![Generate Code Snippet](https://raw.githubusercontent.com/Huachao/vscode-restclient/master/images/code-snippet.gif)
386400
Once you’ve finalized your request in REST Client extension, you might want to make the same request from your source code. We allow you to generate snippets of code in various languages and libraries that will help you achieve this. Once you prepared a request as previously, use shortcut `Ctrl+Alt+C`(`Cmd+Alt+C` for macOS), or right-click in the editor and then select `Generate Code Snippet` in the menu, or press `F1` and then select/type `Rest Client: Generate Code Snippet`, it will pop up the language pick list, as well as library list. After you selected the code snippet language/library you want, the generated code snippet will be previewed in a separate panel of Visual Studio Code, you can click the `Copy Code Snippet` icon in the tab title to copy it to clipboard.

0 commit comments

Comments
 (0)