Signature hashes for user authentication in script


#1

I was thinking that by exposing the signature hash function ( DataServerAccountInfo::getUsernameSignature in DataServerAccountInfo.cpp) to script, users can generate a signature hash and return it in an object along with their username which can be verified by their public key at https://metaverse.highfidelity.com/api/v1/users/Cracker.Hax/public_key.

I believe HiFi servers generate these, so if the user has decided they do not want to be authenticated (and wants to be anonymous) this could return a null signature or not based on their own privacy settings.

Also, all references to username in script (such as GlobalServices.username) could be removed so AC scripts forced on users cannot find the real username any other way.

For those of you who don’t know how signature hashes work, [here][1] is a description. In this case though the private key and signatures are generated on the HiFi servers so the interface has no access to their own private key.

We need something like this anyway, especially if you will be able to handle whitelist/blacklist domain access via persistent script (which I think is a MUST).

Maybe somebody who knows more about this could chime in, but from what I see this seems to be a good way to handle it.
[1]: https://en.wikipedia.org/wiki/Digital_signature


#2

The signature hash returned from that function is specific to the a connection UUID for a domain you are connecting to at that time and I would not advise using it to authenticate users for a separate custom application.

What will help you authenticate and query information for High Fidelity users for a custom application is OAuth, which we already use for Interface authentication and domain-server administration. We will eventually add the ability for users to create their own custom OAuth applications so that they can get valid tokens to verify users and query different account information (depending on what permissions have been asked for).

I don’t think that’s currently a top priority, but I’ll try to gauge how simple that would be to expose so that you can use it shortly.


The Open and Honest Content Provider Community Dialog Thread
#3

Are registered oauth apps something HiFi intends to charge a fee for?


#4

I would say that’s very unlikely.