syl20lego / insomnia-plugin-aws-cognito-token

Insomnia plugin for AWS Cognito
MIT License
44 stars 8 forks source link

Error installing insomnia-plugin-aws-cognito-token@v0.11.0 into Insomnia v7.1.1 #5

Closed calebgregory closed 4 years ago

calebgregory commented 4 years ago

When I click Install In Core on https://insomnia.rest/plugins/insomnia-plugin-aws-cognito-token and attempt adding the plugin, installation fails with this error:

Yarn error warning insomnia-plugin-aws-cognito-token > amazon-cognito-identity-js > buffer@4.9.1: This version of 'buffer' is out-of-date. You must update to v4.9.2 or newer
warning insomnia-plugin-aws-cognito-token > aws-sdk > buffer@4.9.1: This version of 'buffer' is out-of-date. You must update to v4.9.2 or newer
syl20lego commented 4 years ago

this is used by both amazon-cognito-identity-js and aws-sdk, but they are still using 4.9.1 in their latest, I'm waiting for them to update their dependencies.

syl20lego commented 4 years ago

sorry about that...yes only work around for now is to go to the plugin folder and manually install the plugin: git clone https://github.com/syl20lego/insomnia-plugin-aws-cognito-token.git cd insomnia-plugin-aws-cognito-token
npm install

sagun786 commented 4 years ago

@syl20lego Based on this tutorial : https://medium.com/@mauro.canuto88/graphql-with-insomnia-and-aws-cognito-authentication-324c5f6847d7

I am getting error in Live Preview: Unable to verify secret hash for client 56n1ij8fich#######kjb8nc (When TOKEN_TYPE is used as "access").

Is this related to the above version compatibility bug by any chance. I used the manual installation process

syl20lego commented 4 years ago

@sagun786 I don't think your issue is related. Sadly I'm still waiting for AWS to update their library in order to fix the buffer version issue

geoff-ellison commented 4 years ago

sorry about that...yes only work around for now is to go to the plugin folder and manually install the plugin: git clone https://github.com/syl20lego/insomnia-plugin-aws-cognito-token.git cd insomnia-plugin-aws-cognito-token npm install

Hi @syl20lego thank you for this workaround. Once cloned and installed, where do I put it? Thanks.

geoff-ellison commented 4 years ago

sorry about that...yes only work around for now is to go to the plugin folder and manually install the plugin: git clone https://github.com/syl20lego/insomnia-plugin-aws-cognito-token.git cd insomnia-plugin-aws-cognito-token npm install

Hi @syl20lego thank you for this workaround. Once cloned and installed, where do I put it? Thanks.

I found it. Find the plugin folder with Insomnia > Preferences > Plugins > Reveal Plugin Folder. Then copy the entire insomnia-plugin-aws-cognito-token folder into it.

IndyBose commented 4 years ago

Hi, Getting the following error on trying to install the plugin: Error: Cannot find module 'amazon-cognito-identity-js' at Module._resolveFilename (internal/modules/cjs/loader.js:602:15)

gouegd commented 4 years ago

Just sent a PR for the issue noted in the first post. @syl20lego is correct that it is an issue on one of the libraries. Yarn (as well as pnpm) can still force a specific version to be installed, which solves the issue.

syl20lego commented 4 years ago

looks like the fix isn't working, thank Greg for helping. For people looking for a solution, looks like work around is still to go to the plugin folder and manually install the plugin: git clone https://github.com/syl20lego/insomnia-plugin-aws-cognito-token.git cd insomnia-plugin-aws-cognito-token npm install or yarn install

gouegd commented 4 years ago

Interesting, either they use an older version of yarn, or they hand-pick the package.json fields to feed it and they do not support the resolutions one. An alternative is to publish a fork of the aws packages that use the correct dependency version. Or, another one, finding out if Insomnia can support the resolutions field. I'll see if I can have a look at that.

syl20lego commented 4 years ago

I rewrote the aws authentication and remove the cognito dependency. Please use 0.14.1 You now use Region instead of Pool ID, you should edit the configuration to only keep the region part of the pool id. Note: it is backward compatible, so it will extract the region from the Pool ID if left