Skip to content

Insomnia plugin which automatically fetches and prepopulates auth header to any HTTP request

Notifications You must be signed in to change notification settings

alaptseu/insomnia-plugin-authtoken

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

insomnia-plugin-authtoken

If you are sick of expired authentication tokens when running multiple requests in insomnia then try to use this plugin.

Another approach to solve this task is using insomnia chaining requests. However in that case you will need to configure tag with auth response data for every request you are running.

Now, the parameters you are using to get your application token might be different, but you can implement it using this sample as an example. This plugin fetches auth token based on values configured in insomnia environment variables and adds it to the request header in the format of Authorization: bearer <FETCHED AUTH TOKEN>. If your insomnia request already has Authorization header plugin WILL NOT override it so you are flexible there... Compulsory environment variables used by this insomnia plugin are:

{
   "url": "",
   "client_id": "",
   "client_secret": "",
   "password": "",
   "username": ""
 }

To install plugin manually

  1. Checkout this repository;
  2. run npm i
  3. Copy source code to insomnia plugins directory(see paths below);
  4. Create environment variables(see structure above) with your values;
  • MacOS: ~/Library/Application\ Support/Insomnia/plugins/

  • Windows: %APPDATA%\Insomnia\plugins\

  • Linux: $XDG_CONFIG_HOME/Insomnia/plugins/ or ~/.config/Insomnia/plugins/

Todos

  • Write Tests
  • Publish plugin to npm

About

Insomnia plugin which automatically fetches and prepopulates auth header to any HTTP request

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published