使用 Spring Azure OAuth 时从不同来源加载用户角色
Loading user roles from different source while using Spring Azure OAuth
我们正在开发 Spring 应用程序,我们已决定使用 Azure OAuth 作为身份验证方法。问题是我们不想在 AAD 中存储角色。我们只想使用 AAD 来确认用户身份并从其他来源加载其余数据(如角色)。这可能吗?解决这个问题的最佳方法是什么?
我想我找到了解决方案,我可以为@PreAuthorize 编写自定义方法:https://dreamix.eu/blog/java/implementing-custom-authorization-function-for-springs-pre-and-post-annotations
我们正在开发 Spring 应用程序,我们已决定使用 Azure OAuth 作为身份验证方法。问题是我们不想在 AAD 中存储角色。我们只想使用 AAD 来确认用户身份并从其他来源加载其余数据(如角色)。这可能吗?解决这个问题的最佳方法是什么?
我想我找到了解决方案,我可以为@PreAuthorize 编写自定义方法:https://dreamix.eu/blog/java/implementing-custom-authorization-function-for-springs-pre-and-post-annotations