ruimarinho / bitcoin-core

A modern Bitcoin Core REST and RPC client.
480 stars 188 forks source link

Support for rpcauth / .cookie file authentication #30

Closed sheerlox closed 7 years ago

sheerlox commented 7 years ago

Hi !

We can see that rpcuser and rpcpassword are deprecated on bitcoin/bitcoin/blob/master/contrib/debian/examples/bitcoin.conf#L70-L84:


# If no rpcpassword is set, rpc cookie auth is sought. The default `-rpccookiefile` name
# is .cookie and found in the `-datadir` being used for bitcoind. This option is typically used
# when the server and client are run as the same user.
#
# If not, you must set rpcuser and rpcpassword to secure the JSON-RPC api. The first
# method(DEPRECATED) is to set this pair for the server and client:
#rpcuser=Ulysseys
#rpcpassword=YourSuperGreatPasswordNumber_DO_NOT_USE_THIS_OR_YOU_WILL_GET_ROBBED_385593
#
# The second method `rpcauth` can be added to server startup argument. It is set at initialization time
# using the output from the script in share/rpcuser/rpcuser.py after providing a username:
#
# ./share/rpcuser/rpcuser.py alice
# String to be appended to bitcoin.conf:
# rpcauth=alice:f7efda5c189b999524f151318c0c86$d5b51b3beffbc02b724e5d095828e0bc8b2456e9ac8757ae3211a5d9b16a22ae

Is support for authenticating with rpcauth or the .cookie file planned ?

Seems rpcauth is the best to implement as we shouldn't run node and bitcoind under the same user imo.

Thanks in advance

pedrobranco commented 7 years ago

Hi there,

rpcauth option is only to be used for server side authentication.

You will still need to pass the rpcuser and rpcpassword in the bitcoin-core. Source: https://github.com/bitcoin/bitcoin/blob/master/contrib/debian/examples/bitcoin.conf#L88

Cheers.

sheerlox commented 7 years ago

So I put rpcauth encrypted user and pass on server and I use rpcuser and rpcpassword on client ?

pedrobranco commented 7 years ago

Exactly, rpcauth option is to grant that your password is stored in an encrypted way.

sheerlox commented 7 years ago

Thanks a lot !!