java - What is the best way to perform permission verification in a distributed system?
typecho
typecho 2017-06-30 09:55:01
0
3
1210

As the title states, in the project, there is a separate system as the permission system. The current approach is that every time a request is made to the business system, it will be intercepted by the business system and the requested URL will be passed to the permission system for verification. Verify whether the user making the request has the permission.

Or you can also obtain all the permissions of the user from the permission system and verify them in the business system

No matter which method is used, I feel that it can be tampered with in the middle, and it does not feel very unsafe

I would like to ask if it is better to perform permission verification in a distributed system. Thank you, senior

typecho
typecho

Following the voice in heart.

reply all(3)
仅有的幸福

The original poster’s problem has nothing to do with permissions, it’s purely about the security of interface calls. The general methods are:

  1. The content is transmitted in clear text, but a check code is added. The check code is generated by a key agreed by both parties. The tamperer cannot generate the correct check code.

  2. Encrypt and decrypt the entire transmission using the agreed key.

習慣沉默

After logging in, request the permission system and put the returned permission menu and other information into the cache (use Map or Nosql to implement it yourself. It is recommended to use Nosql cluster. Please note that if the menu is updated, clear the user's redis data first, and then synchronize the latest information to redis, redis takes it from the database if there is no information), and then returns the Java Web Token (including timestamp, identification, etc.).

Https and Spring-Security (access interface permissions, CSRF prevention) are used for project security. Each interface must be signed, and the token must be timestamped.

ringa_lee

This is a bit like the problem solved by OAuth2.0

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!