Reputation: 21
hi friends, iam trying to integrate office 365 with my application.just few days back when i made a get request to https://outlook.office365.com/ews/odata/Me/Events with header part as followed: Authorization:Bearer access token it showed all events of office 365 account.but when i try doing the same thing it is showing an error saying that x-ms-diagnostics: 2000001;reason="Unable to read or process token, additional details: 'Jwt10204: 'System.IdentityModel.Tokens.JwtSecurityTokenHandler' cannot read this string: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6ImtyaU1QZG1Cdng2OHNrVDgtbVBBQjNCc2VlQSJ9.eyJhdWQiOiJodHRwczovL291dGxvb2sub2ZmaWNlMzY1LmNvbSIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0LzlmYzNhMzkxLTAwZjYtNGU2Zi05OTRjLTg3ZjFhZjRhNjdjMS8iLCJpYXQiOjE0MTg1NDk3MzIsIm5iZiI6MTQxODU0OTczMiwiZXhwIjoxNDE4NTUzNjMyLCJ2ZXIiOiIxLjAiLCJ0aWQiOiI5ZmMzYTM5MS0wMGY2LTRlNmYtOTk0Yy04N2YxYWY0YTY3YzEiLCJhbXIiOlsicHdkIl0sIm9pZCI6Ijk2NzllNzU1LTc4NmItNDI5OS1hZDk2LWViYjZkNTY3ZGI5MiIsInVwbiI6ImFua2l0YUB4dHJlYW1wcGwub25taWNyb3NvZnQuY29tIiwidW5pcXVlX25hbWUiOiJhbmtpdGFAeHRyZWFtcHBsLm9ubWljcm9zb2Z0LmNvbSIsInN1YiI6InZON0IyVEo2UEJhblBuV0VrV2dFeVhsUnZqNkdjVXQzeUgwMnducWRUNVkiLCJwdWlkIjoiMTAwMzNGRkY4Q0REMUEzNiIsImZhbWlseV9uYW1lIjoibmF2ZWVuIiwiZ2l2ZW5fbmFtZSI6Imt1bWFyIiwiYXBwaWQiOiJiNDQzNjE4ZS1jMGM4LTQ4YjQtOTBjYi00NjczNGUyNzA2MmQiLCJhcHBpZGFjciI6IjEiLCJzY3AiOiJDYWxlbmRhcnMuUmVhZCBDYWxlbmRhcnMuV3JpdGUgQ29udGFjdHMuUmVhZCBDb250YWN0cy5Xcml0ZSBmdWxsX2FjY2Vzc19hc191c2VyIE1haWwuUmVhZCBNYWlsLlNlbmQgTWFpbC5Xcml0ZSIsImFjciI6IjEifQ.f_-kJQiSk0q-CAFK7JnirIT2-Tf2aSl6vgk-gTdmufm-e6siffqSRcyr3vIEfb62NN-Mfwv8coccaE7WlbxV7EWC9GGgoEKin-CkWPZFZZiCeKo_3nl8GYZWAfVf_u7eh9I3pfH9Trd5S7Se6lP1osUXajP2VLUYtmQ0nXWaJVKx9MvdhMiHjYdHRyA8oTyjWF0vII2UBkn8U8uN9oH9GSD3XKumsy52wbC87M3IO-A0pb-qlBDDM3OW2w3Uaw870hj-j01l9rDX_z5PnshZqYMqXwR7RHOe3vcHycykcElb_Rl0yVzS207uRfP30_HCyBLt7Vlho9AOLTJQVE07Aw:'.%0aThe string needs to be in compact JSON format, which is of the form: '..'.'.";error_category="invalid_token"
Upvotes: 0
Views: 344
Reputation: 2883
Please take a look at a related Stack Overflow thread that should help solve your problem. The issue is that you have selected all permissions and this includes the permission "Have full access to a user's mailbox". That permission is intended for Exchange Web Services SOAP API and not the Office 365 REST API you are using. Unchecking that permission for your app should make the requests succeed.
Selecting all permissions when trying out an API is natural but we have a bug on our side that is most likely causing your requests to fail. We are in the process of deploying a fix that addresses this issue by ignoring the "Have full access to a user's mailbox" for REST API requests and the fix should be deployed by end of January. Sorry for the inconvenience.
Please let me know if you try that and your request is still failing.
Thanks,
Venkat
Upvotes: 0
Reputation: 17702
Try copying the access token and pasting into a JWT parser like http://jwt.calebb.net/. The string you included in your original post doesn't look like valid base 64. There seems to be a trailing ':' that is causing it not to parse.
Upvotes: 1