我们正在开发 Spring 应用程序,并决定使用 Azure OAuth 作为身份验证方法。问题是我们不想在 AAD 中存储角色。我们希望使用 AAD 只是为了确认用户身份并从其他来源加载其余数据(例如角色)。这可能吗?解决这个问题的最佳方法是什么?
最佳答案
我想我找到了一个解决方案,我可以为@PreAuthorize编写一个自定义方法:https://dreamix.eu/blog/java/implementing-custom-authorization-function-for-springs-pre-and-post-annotations
关于spring - 使用 Spring Azure OAuth 时从不同源加载用户角色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59394097/