Reputation: 1
I am trying to get outlook mails in my application using Outlook REST APIS
I have registered my application in AAD using my outlook account.
I have managed to get authorization code using:
However when i use code received from the redirect request I get:
{ "error":"invalid_client", "error_description":"AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.\r\nTrace ID: 8305c47e-aabf-4837-bcbc-92169e8016a5\r\nCorrelation ID: 986e4afe-bd40-4717-b712-034227762f19\r\nTimestamp: 2016-04-05 21:34:37Z",
"error_codes":[70002,50012], "timestamp":"2016-04-05 21:34:37Z", "trace_id":"8305c47e-aabf-4837-bcbc-92169e8016a5", "correlation_id":"986e4afe-bd40-4717-b712-034227762f19" }
I have tried same from Java code and using REST client both.
Anyone else faced this issue?
Upvotes: 0
Views: 1500
Reputation: 136146
Based on the Authorization Code Grant Flow
here: https://msdn.microsoft.com/en-in/library/azure/dn645542.aspx, you're missing the step of acquiring access token (Step 4 in the picture below).
Using the code, you would need to get the access token and then use that access token you should be able to access Outlook REST API.
Upvotes: 0