Code Monkey home page Code Monkey logo

Comments (7)

Magister-Machinis avatar Magister-Machinis commented on May 27, 2024

Quick update, tried this with the v2023.1.0 cli to be certain of compatibility and get the same error.

from terraform-provider-bitwarden.

maxlaverse avatar maxlaverse commented on May 27, 2024

Hi @Magister-Machinis! Sorry for the late reply.
Thanks for providing those information. I need to think about it a bit more as I don't have a quick idea about what could be broken here.

from terraform-provider-bitwarden.

Magister-Machinis avatar Magister-Machinis commented on May 27, 2024

No worries! I added another log to the gist and made sure it had debug info if that is helpful. Let me know if any other info could be useful.

from terraform-provider-bitwarden.

maxlaverse avatar maxlaverse commented on May 27, 2024

Thanks again for the gist.

I was trying to play around the login command with my local Bitwarden client which is actually 2023.5.0. Interestingly, by entering non-sense as client_id and client_secret, I got the same result as you:

bw login --apikey
? client_id: bla
? client_secret: bla
Invalid API Key; Organization API Key currently not supported

More specifically, I got this error when using a client_id value that wouldn't start with user.*. Altering the client_id or client_secret but keeping the former prefixed with user.* results in Invalid client_id or Incorrect client_secret errors, but nothing about organizations api keys.

Now I'm curious: if there is a dot in your client_id, what's in front of it ?
It seems the error message you're seeing comes from a server-side validation, so I would think something is wrong with the client_id:

  • typo in the value
  • value not set properly by the provider
  • value not read properly by the cli

if I run bw.exe --apikey separately the login attempt is successful.

Could you try setting the BW_CLIENTID and BW_CLIENTSECRET environment variable, and then run bw.exe login --api-key, like the provider does ? From a different angle, could you try hard-coding the values in the provider "bitwarden" {} declaration, just in case ?

Thanks!

from terraform-provider-bitwarden.

Magister-Machinis avatar Magister-Machinis commented on May 27, 2024

So running bw.exe login --apikey with the secret and id as environment variables works. Interestingly hard coding the id, secret, and pw also works in tf plan. Passing them as variables seems to be the issue. did some poking and found that removing quotes from variables being passed in seems to fix this! Thank you for help with troubleshooting, would a bit of input sanitization to remove leading/trailing quotes be possible?

from terraform-provider-bitwarden.

maxlaverse avatar maxlaverse commented on May 27, 2024

Glad you sorted it out!
Sanitization definitely makes sense, and maybe those field have a format we could add to the provider's schema for validation.

from terraform-provider-bitwarden.

Magister-Machinis avatar Magister-Machinis commented on May 27, 2024

Great, thanks again for the assistance.

from terraform-provider-bitwarden.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.