1

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

Sree
  • 2,792
  • 8
  • 25
  • 33
  • your link isn't working for me - does anyone else has this problem? – Martin Frank Sep 04 '15 at 12:00
  • @Martin Frank : Thanks for your response. Yeah the link won't work because I didn't give scope,client_id and redirect_uri. scope=wl.basic & client_id is my api key which I can't share here and redirect_uri is just url which we want to redirect to particular servlet where we need to get user info. ie like http://localhost:8080/callback. Help me if any one knows about this ? – Sree Sep 04 '15 at 13:22

2 Answers2

3

The userinfo endpoint is https://apis.live.net/v5.0/me. Before you call it you need to exchange the code for a token.

Eugenio Pace
  • 14,094
  • 1
  • 34
  • 43
  • 1
    Thank you so much for your suggestion. I'm exchanging code for token with `https://login.live.com/oauth20_token.srf` And I followed https://msdn.microsoft.com/en-us/library/hh243641.aspx site. It worked for me. – Sree Sep 07 '15 at 09:25
0

For anyone stumbling here.

OpenID discovery URL: https://login.live.com/.well-known/openid-configuration

Microsoft doesn't provide userinfo_endpoint in the service configuration json

UserInfo URL : https://graph.microsoft.com/v1.0/me

Make a GET request to this url with header containing access_token that you got after exchanging auth_code

Key: Authorization

Value: Bearer <access_token>

Arpit Agarwal
  • 326
  • 3
  • 15