【发布时间】:2018-10-19 14:13:12
【问题描述】:
我使用的是微软提供的示例,我验证了自己就好了。身份验证后,我检索有关我的用户的基本信息。如何检索有关我的用户的更多信息(例如街道号码、门牌号码、电话号码等)?
- 我正在使用这个 Azure AD Spring Boot 后端示例 - Github
- 我开始并登录 (https://localhost:8080)
- 认证成功!
- 我获得了有关用户的基本信息(例如姓名、姓氏)
- 我如何获得关于用户的更多信息(例如街道号码、门牌号码、电话号码)?
代码(HomeController.java):
@GetMapping("/")
public String index(Model model, OAuth2AuthenticationToken auth) {
final OAuth2AuthorizedClient client = this.authorizedClientService.loadAuthorizedClient(
auth.getAuthorizedClientRegistrationId(),
auth.getName());
// Name, Surname
model.addAttribute("userName", auth.getName());
model.addAttribute("pageTitle", "Welcome, "+auth.getName());
// Azure info
model.addAttribute("clientName", client.getClientRegistration().getClientName());
// HERE I WANT TO SEND A (MICROSOFT OR AD) GRAPH API REQUEST TO GET
// THIS USER'S ADDRESS (street number, house number, etc.)
return "index";
}
【问题讨论】:
-
你有关于这个线程的任何更新吗?如果它有用,您可以将其标记为答案。
标签: java spring azure spring-boot active-directory