Spring-boot-security中principal和credientials的含义

在Spring Boot Security中,"principal"(主体)和"credentials"(凭据)是两个重要的概念。

1. Principal(主体):
   Principal代表当前与系统交互的用户或实体的身份信息。它可以是用户的用户名、电子邮件地址、唯一标识符或其他任何可以用来标识用户的信息。在Spring Boot Security中,Principal通常代表经过身份验证的用户。

2. Credentials(凭据):
   Credentials代表用户或实体用于验证身份的证书、密码或其他安全凭据。在Spring Boot Security中,Credentials通常是用户提供的密码或令牌。

Spring Boot Security使用这些概念来管理身份验证和授权。当用户经过身份验证后,系统将创建一个Principal对象来表示该用户的身份,并使用Credentials来验证其身份。在处理请求时,可以使用Principal对象来获取用户的身份信息,并基于此进行访问控制和权限管理。

需要注意的是,这些术语可能在不同的上下文中有不同的含义,具体取决于系统的实现方式和配置。上述解释是基于一般的Spring Boot Security约定的常见含义。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Pro Spring Boot 2: An Authoritative Guide to Building Microservices, Web and Enterprise Applications, and Best Practices Quickly and productively develop complex Spring applications and microservices out of the box, with minimal concern over things like configurations. This revised book will show you how to fully leverage the Spring Boot 2 technology and how to apply it to create enterprise ready applications that just work. It will also cover what's been added to the new Spring Boot 2 release, including Spring Framework 5 features like WebFlux, Security, Actuator and the new way to expose Metrics through Micrometer framework, and more. This book is your authoritative hands-on practical guide for increasing your enterprise Java and cloud application productivity while decreasing development time. It's a no nonsense guide with case studies of increasing complexity throughout the book. The author, a senior solutions architect and Principal Technical instructor with Pivotal, the company behind the Spring Framework, shares his experience, insights and first-hand knowledge about how Spring Boot technology works and best practices. Pro Spring Boot 2 is an essential book for your Spring learning and reference library. What You Will Learn Configure and use Spring Boot Use non-functional requirements with Spring Boot Actuator Carry out web development with Spring Boot Persistence with JDBC, JPA and NoSQL Databases Messaging with JMS, RabbitMQ and WebSockets Test and deploy with Spring Boot A quick look at the Spring Cloud projects Microservices and deployment to the Cloud Extend Spring Boot by creating your own Spring Boot Starter and @Enable feature Who This Book Is For Experienced Spring and Java developers seeking increased productivity gains and decreased complexity and development time in their applications and software services.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值