Unable to get bitwarden api token

when trying to get the token for bitwarden using

curl -X POST
https://(our bitwarden)/identity/connect/token
-H ‘Content-Type: application/x-www-form-urlencoded’
-d ‘grant_type=client_credentials&scope=api&client_id=(myid)&client_secret=(mysecret)’

i get

“error”:“invalid_grant”,“ErrorModel”:{“Message”:“No device information provided.”,“Object”:“error”}}

note/ SSL is enabled ,

1 Like

Hi @mdhussein - it sounds like a server-side issue. Can you provide a bit more info, such as what version of Bitwarden server you are running, what hardware/OS it runs on, and what procedure you followed to install it?

Hello David thanks for responding
i only know the version 2.25.0

i think this is a common issue.
i read something about bw cli. ill try to use it for automating my project.

My guess is you are not actually using a Bitwarden product. There are Bitwarden imposters out there that are designed to look like you are running Bitwarden Server, but they are something else entirely. Are you sure you trust storing all your secrets in software that you aren’t even sure where it came from?

I’m pretty sure what @dh024 says is wrong. This error happens when you hit the public API authentication endpoint with user credentials instead of org credentials. At least, that’s what is the case in my case.

I have exactly the same issue because I do not want to make use of the org key just to retrieve error logs, which seems dangerous.

try blow one

curl --location --request POST 'https://identity.bitwarden.com/connect/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'scope=api' \
--data-urlencode 'client_id=<ID>' \
--data-urlencode 'client_secret=<ID>' \
--data-urlencode 'deviceName=fireFox' \
--data-urlencode 'twoFactorToken=0' \
--data-urlencode 'deviceIdentifier=0' \
--data-urlencode 'deviceType=0'

So, to solve this problem i have to use the org credentials?