简体   繁体   English

使用 spring 安全性验证 Azure AD 访问令牌

[英]Validate Azure AD access token with spring security

What is the easiest way to switch from jsession based authentication to a token based authentication with Azure AD and Spring security?从基于 jsession 的身份验证切换到具有 Azure AD 和 Spring 安全性的基于令牌的身份验证的最简单方法是什么? The documentation is not clear on other approaches to authenticate with azure AD other than the default session based one.除了默认的基于 session 的方法之外,该文档不清楚其他使用 azure AD 进行身份验证的方法。

I am trying to see how can I validate the jwt access token using azure AD.我正在尝试查看如何使用 azure AD 验证 jwt 访问令牌。 The default implementation works with session based authentication (which will not work in a system with multiple instances.) The session-stateless property mentioned in the doc doesn't seem to have any effect on the authentication.默认实现适用于基于 session 的身份验证(在具有多个实例的系统中不起作用。)文档中提到的会话无状态属性似乎对身份验证没有任何影响。

Spring Cloud Azure integrate Spring Security with Azure Active Directory. Spring 云 Azure将 Spring 安全与 Azure Active Directory 集成。

You could use spring-cloud-azure-starter-active-directory starter to integrate with Spring Security, please refer this sample to see how to use it.您可以使用spring-cloud-azure-starter-active-directory starter 与 Spring Security 集成,请参考此示例以了解如何使用它。

For further reading, please refer the Azure Active Directory dev guide , it covers these scenarios for you:如需进一步阅读,请参阅Azure Active Directory 开发指南,它涵盖了以下场景:

  • Access a web application接入web申请
  • Access resource servers from a web application从 web 应用访问资源服务器
  • Protect a resource server/API保护资源服务器/API
  • Access other resource servers from a resource server从一个资源服务器访问其他资源服务器
  • Web application and resource server in one application Web 应用和资源服务器合二为一

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM