angular.js - How to safely use cookies to control user permissions after angularjs login
巴扎黑
巴扎黑 2017-05-15 16:54:55
0
2
612

Requirement: A project that completely separates the front-end and back-end, only interacting through API. After the user successfully logs in, the back-end writes the user's name and permissions into a cookie, and the front-end gives different users different permissions based on the cookie

Thinking: Writing permissions to cookies is easy, but how to ensure security?

巴扎黑
巴扎黑

reply all(2)
Peter_Zhu

Applications written in angularjs must verify user permissions on both the front and back ends. Because angularjs is a single-page application, all codes are on the front end, and users can modify them at will. Please refer to: https://blog.coding.net/blog/techniques- for-authentication-in-angular-js-applications

阿神

Put a SessionID in the cookie, and put other user and permission-related data in the cookie. Users can basically log in without entering their username and password.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template