Hi I had the same proble recently trying to upgrade in a project magento from 2.0.4 to 2.1.9.
Nothing seemed to work...but... I deleted the auth.json, I made on the repo a new token and a new set of keys, then I recreated globally the auth.json. When I pasted the 2 keys I noticed that a blank typo was before each key. I deleted the 2 typos and "voila" I was able to do the job.
Bit late, but you do realise that it won't output the password that you're typing to the screen? So you won't have any visual feedback that your password is being entered.
open composer.json file and add following code after this line
add the following code here
"username": "<Public key>",
"password": "<Private key>"
runt the command
Double check in directories/files permissions and owner. I have the same issue and I fixed just doing this:
chown -R youserverruser:yourserveruser .
In my case was
chown -R www-data:www-data .
The solution is to use you acces key from https://marketplace.magento.com
USERNAME= PUBLIC KEY
PASSWORD= PRIVATE KEY
In my case my own public private key wasn't working. I requested from team-mate and it worked with his authentication keys. strange though but that is what happened.
Get your public key and private key from magento marketplace and add them in auth.json file.