- Hands-On Spring Security 5 for Reactive Applications
- Tomcy John
- 274字
- 2021-07-23 18:59:24
Authorization
Once the user is validated in terms of who they claim to be, the next aspect, what the user has access to, needs to be ascertained. This process of making sure what the user is allowed to do within the application is called authorization.
In line with authentication architecture, as seen earlier, authorization also has a manager, AccessDecisionManager. Spring Security has three built-in implementations for this: AffirmativeBased, ConsensusBased, and UnanimousBased. AccessDecisionManager works by delegating to a chain of AccessDecisionVoter. Authorization-related Spring Security classes/interfaces are shown in the following diagram:
In Spring Security, authorization to a secured resource is granted by invoking voters and then tallying the votes received. The three built-in implementations tally the votes received in different manners:
- AffirmativeBased: If at least one voter votes, the user is given access to the secured resource
- ConsensusBased: If a clear consensus is reached between the voters and their votes, then the user is given access to the secured resource
- UnanimousBased: If all the voters vote, then the user is given access to the secured resource
Spring Security provides two authorization approaches:
- Web URL: Incoming URL (specific URL or regular expression)-based authorization
- Method: Method signature based on which access is controlled
If your serving layer exposes only RESTful endpoints and the data in your application is properly categorized as resources (complying with REST principles), using a Web URL approach can be considered. If your application just exposes endpoints (REST-based, I would call) not really complying with REST principles, you can consider using method-based authorization.
- 數(shù)字身份與元宇宙信任治理
- 網(wǎng)絡(luò)空間攻防技術(shù)原理
- 大型互聯(lián)網(wǎng)企業(yè)安全架構(gòu)
- 黑客攻防入門秘笈
- 開發(fā)者的Web安全戒律:真實威脅與防御實踐
- 工業(yè)控制網(wǎng)絡(luò)安全技術(shù)
- 黑客攻防與無線安全從新手到高手(超值版)
- 計算機網(wǎng)絡(luò)安全技術(shù)研究
- 安全防御入門手冊
- 電腦安全與攻防入門很輕松(實戰(zhàn)超值版)
- VMware vCloud Security
- 黑客攻防從入門到精通:命令版
- Kali Linux無線網(wǎng)絡(luò)滲透測試詳解
- 黑客攻防從入門到精通:絕招版(第2版)
- INSTANT Microsoft Forefront UAG Mobile Configuration Starter