insomnia-plugin-cookie-auth is a plugin that allows extracting a specific cookie containing an oauth2 authorization
token (or something containing an access_token
field). It will detect if the cookie or token has expired and
make send the request to retrieve an updated cookie or token.
This isn't published on NPM, so it needs to be manually installed.
- Clone the repository to the Insomnia plugins folder
e.g.cd <insomnia plugins folder>; git clone <url>
- Install the dependencies
- npm:
npm install
- yarn:
yarn install
- npm:
- Build it
- npm:
npm run-script build
- yarn:
yarn build
This should produce:index.js
- npm:
- Open Insomnia or tell it to reload plugins
- There should be a new template tag called
Cookie Auth Token
- Provided the necessary configuration
- Request: This is the which request the plugin should make if the token or cookie has expired
- Cookie Domain: This is the domain name that the cookie that set the cookie.
This is required as it's possible to have multiple cookies named the same. - The name of the cookie that will contain the access token.