Angularjs-angular applications. If php is a restapi, how can we ensure api security?

Source: Internet
Author: User
The front end uses angularjs to implement single-page applications. If thinkPHP is used as a restapi at the backend, how can we ensure api security? A single-page application is used in the public account. After clicking it, it jumps to this application. If you are not logged on, you only need to use openid to determine whether to register the application. Then some personal emails are involved... the front end uses angularjs to implement single-page applications. If thinkPHP is used as the rest api at the backend, how can we ensure api security?
The single-page application is used in the public account. Click the public account to jump to the application. OpenidTo determine whether to register, and then some personal information will be involved.

Reply content:

The front end uses angularjs to implement single-page applications. If thinkPHP is used as the rest api at the backend, how can we ensure api security?
The single-page application is used in the public account. Click the public account to jump to the application.OpenidTo determine whether to register, and then some personal information will be involved.

After logging on, generate the token and store it in the browser's sessionStorage. Each time you get the data, send the token and compare it with the server to determine whether to log on, and then obtain the data such as json response.

Please see: https://segmentfault.com/a/1190000004715...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.