Domanda

Im looking to use NPGSQL for a simple Unity WebApp for highscore and User statistics on my website. The code to initilalize NPGSQL is:

NpgsqlConnection conn = new NpgsqlConnection("Server=server.servername.com:port; User Id=username; Password=password; Database=databaseid; ");
conn.Open();

Now, the issue I have is that Unity and .Net in general are difficult to obfuscate and I have no wish to have my database password simply sitting around in a web app.

What would be the best way to secure the password while still letting the Unity code read and write data to the database?

Info:

  • Unity: 4.3
  • Website: Ruby (2.0.0) Rails (4.0.1)
  • Hosted: Heroku
È stato utile?

Soluzione

Why connecting to the database server directly from Unity client Web App? You probably should expose some API in your Web layer returning data in e.g. JSON to Unity and just showing it in some desirable form. And of course you will need to pass login/password from Unity Web app to authenticate first in your API. Or even it is more simpler to implement client on already used Web stack - RoR.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top