Skip to content

Commit

Permalink
Feature: AWS Cognito support (#1097)
Browse files Browse the repository at this point in the history
* 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 <huachaomao@gmail.com>
  • Loading branch information
danitt and Huachao authored Aug 15, 2024
1 parent c023cac commit 97114a5
Show file tree
Hide file tree
Showing 5 changed files with 15,154 additions and 1,877 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ REST Client allows you to send HTTP request and view the response in Visual Stud
- Azure Active Directory
- Microsoft Identity Platform
- AWS Signature v4
- AWS Cognito
* Environments and custom/system variables support
- Use variables in any place of request(_URL_, _Headers_, _Body_)
- Support __environment__, __file__, __request__ and __prompt__ custom variables
Expand Down Expand Up @@ -381,6 +382,19 @@ GET https://httpbin.org/aws-auth HTTP/1.1
Authorization: AWS <accessId> <accessKey> [token:<sessionToken>] [region:<regionName>] [service:<serviceName>]
```

### AWS Cognito
To authenticate via AWS Cognito, you need to set the Authorization header schema to `COGNITO` and provide your AWS credentials separated by spaces:
- `<Username>`: AWS Username for target user
- `<Password>`: AWS Password for target user
- `<Region>`: AWS Region for Cognito pool
- `<UserPoolId>`: AWS Cognito User Pool ID
- `<ClientId>`: AWS Cognito Client ID

```http
GET https://httpbin.org/aws-auth HTTP/1.1
Authorization: COGNITO <Username> <Password> <Region> <UserPoolId> <ClientId>
```

## Generate Code Snippet
![Generate Code Snippet](https://raw.githubusercontent.com/Huachao/vscode-restclient/master/images/code-snippet.gif)
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.
Expand Down
Loading

0 comments on commit 97114a5

Please sign in to comment.