After much consideration, I have decided to go with a pure HTML and JS front end approach where all processing takes place in the client-side browser and the backend simply serves data in JSON, XML, or other formats.
However, I am facing a dilemma.
For authentication, I am using OAuth2 Bearer tokens that are generated when users authenticate using their username and password (for example, during login).
To add an extra layer of security, the clientside application (e.g. a front end web server or mobile app) making requests to the WebAPI needs to include a "client_id" and "client_secret" to ensure authorization to access the backend server.
In the traditional .NET way, I would store the encrypted client ID and key in the web.config file, which my C# (or VB.NET) code would retrieve and send over SSL to the server, keeping the client_id and client_secret hidden from the rendered HTML on the client side browser.
Now, in a purely JavaScript environment, how can I securely protect my client_id, client_secret, or any other sensitive data for that matter?
Thank you