How effectively can I use angularjs keeping security in mind?

后端 未结 3 1466
醉梦人生
醉梦人生 2021-01-26 11:22

Why should I use angular.js or other like js frameworks when I know they are not secured.

What I mean by security is:

  • All the code is written in pure javas
相关标签:
3条回答
  • 2021-01-26 11:52

    Of course you should use minification js tool for your client side code if you worried about its logic. But keep in ming this:

    • Do not keep service info (like many id`s and etc.) on client
    • And always use both type of validation in dangerous places
    • Use crypto/tokens
    0 讨论(0)
  • 2021-01-26 11:54

    All client side code is susceptible to modification. For that reason you don't put anything that needs to be secure into the client code. The client code should define the view elements for the end user and give them an easy means to communicate with the server. Regarding security 99% of this needs to be handled server side by appropriately protecting the data that is sensitive. In terms of server to client communication you need to use SSL. Angular has some things built in to help with security see $sce and ngSanitize but IMHO your back-end should be safe because anyone can re-write a front end or use a command line tool to send various curl requests at the server until something gives. The client code really has no need to contain anything proprietary outside of the client code itself if that's your concern you can use obfuscation tools but ultimately even compiled code can be decompiled or disassembled .

    0 讨论(0)
  • 2021-01-26 12:01

    You should always do both client and server-side validation. No matter what library you're using, this is required. It shouldn't be seen as "double" the work. It's just "the work".

    Even if you weren't using Angular (or another Javascript library), I could still use devtools to make a request via Javascript to your server - it still needs to handle it.

    If you're worried about code security, you can use an obfuscation/minification tool.

    0 讨论(0)
提交回复
热议问题