Authentication for clients?
Balmark
Join Date: 2002-11-01 Member: 3476Members, Constellation, Reinforced - Silver, Reinforced - Shadow, WC 2013 - Shadow
Hey
Is there any unique string or number or something I can take to give some form of authentication that a request has come from within NS2?
I can GetSteamId from Client .. and GetUserName .. but is there anything I can get from the Client that will allow me some way to validate that a request has come from a user while the game is running and not someone trying to spoof ? some form of pgp from within the engine I could use a public key to check its valid?
Cheers,
Bal
Is there any unique string or number or something I can take to give some form of authentication that a request has come from within NS2?
I can GetSteamId from Client .. and GetUserName .. but is there anything I can get from the Client that will allow me some way to validate that a request has come from a user while the game is running and not someone trying to spoof ? some form of pgp from within the engine I could use a public key to check its valid?
Cheers,
Bal
Comments
BTW for what exactly do you want to use such a check?
Was hoping something like
String Client.getEncryptedSteamId() that's encrypted with some UWE private key and I dunno (possibly pass some salt in as a parameter or something) .. I could do some more encrypting and then send it to a webservice, decrypt on a webservice side plus decrypt it using UWE public key to show the steamid is from the actual client (more interested about stopping others using other ppls steamid .. even just making it hard .. passwords would probably be needed in the end :P )
client: HI, I say I am 'Steam_0:0:123' ...
mod server: ok .. 123 .. here's salt 'abc' please give me an encrytped string using my salt and your private key I can decrypt ... use salt abc
client: ok, using salt abc, your encrypted string for 'Steam_0:0:123:abc' is hhhhgggaaa (this is based off a private getSteamID + encrypting with private key
mod server: ok using your public key, I can decrypt your string and get 'Steam_0:0:123:abc', so you came from ns2.exe that have Client.getSteamID 'Steam_0:0:123'
My mod can get random salts from the webservice and then use the hhhhgggaaa as a 'token' to send with requests
Anyhow.. regardless, it doesn't exist at the moment .. so no point going over it
If your mod depends on the client sending HTTP requests including their SteamID and it has to be the correct ID, then you got a problem. You can never trust data from the client, you can't get around that. Perhaps you could have the server send whatever it is that needs to be sent instead?