成功通过身份验证后如何使用 Microsoft OAuth 获取用户信息 [英] How to get userinfo with Microsoft OAuth after successfully authenticated
问题描述
我的应用程序应该使用 Microsoft 帐户(OAuth 提供程序)登录.使用以下 URL 成功通过身份验证后,我无法获取用户信息https://login.live.com/oauth20_authorize.srf?client_id=CLIENT_ID&scope=SCOPES&response_type=code&redirect_uri=REDIRECT_URL任何人都可以帮我获取用户信息吗?有没有我需要包含的库?我正在获得经过验证的代码,但我不知道如何使用?我正在使用 JAVA
My applications should login with Microsoft account (OAuth Provider). I got stuck to get user info after successfully authenticated by using following URL https://login.live.com/oauth20_authorize.srf?client_id=CLIENT_ID&scope=SCOPES&response_type=code&redirect_uri=REDIRECT_URL Can any one please help me to get user-info? Is there any library that I need to include for that ? I'm getting authenticated code but I don't know how use ? I'm working with JAVA
推荐答案
userinfo 端点是 https://apis.live.net/v5.0/me
.在调用它之前,您需要将 code
交换为 token
.
The userinfo endpoint is https://apis.live.net/v5.0/me
. Before you call it you need to exchange the code
for a token
.
这篇关于成功通过身份验证后如何使用 Microsoft OAuth 获取用户信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!