Occ user:auth-tokens:add (custom password doesn't work)

Hi

I’m trying to create an auth-token for a user with a custom password. Taking a look to the documentation it can be done with:

export NC_PASS=mypassword
su -s /bin/sh www-data -c 'php occ user:auth-tokens:add MyUser --password-from-env'

And the answer is:

app password:
H93Ddv3Zy0x90ssDcmMsBIoFqUFRdgOpIhIi3mBUTMHnt9TPR0bVGxKPpGdfkyH7JieTrW32

But I don’t want a generated password, I want to use in this example “mypassword”. How could I set a specific one? I’ve tried also with OC_PASS since some settings use that, same result.

Thks

app password must be very long and random string and I don’t think there is an option to pre-populate the app password. Examples show how to provide a password for user:add but not for an auth-token… I could also imagine the string mypassworddoesn’t pass the password policy and the tool fallback to a default one. and definitely there is no good real reason to access predefined unsecure string as app password… so might be it is intentionally not implemented.

It’s a little confusing, but that parameter - when used in this particular context - isn’t used to specify a custom app password itself. It’s used to specify the login password that gets embedded within the app password token itself.