Microsoft 365 Online WebAPI operations gives 401 - Unauthorized: Access is denied when accessed using OAuth RRS feed

  • Question

  • Hello CRM Experts,

    I am trying to connect to our organization's DynamicsCRM 365 Online system using OAuth authentication and Java. I have tried both ways to get the access tokens:

    1. Authorization Code Grant and
    2. Client_Credentials Grant

    In both cases, I am successful to generate access_tokens. No issues here.

    Now using the generated access_token I am supplying it as a Authorization header in my WebAPI operation to GET an entity attributes fails with the 401 Unauthorized Access error. No luck if I use either Authorization grant flow or the Client_Credential, in both cases I get Unauthorized Access.

    Below is how my WebAPI GET call which I am trying to make using a valid access_token
    https organization_name>.api.crm.dynamics.com/api/data/v8.2/EntityDefinitions(LogicalName='opportunity')/Attributes


    1. Can we access DynamicsCRM 365 Online resources using OAuth and WebAPI operation calls?
    2. For obtaining the access tokens what type of grant flow we should be using?

    In one of the CRM blog post it suggested that it is not fully supported, can somebody confirm?

    If some CRM expert or MVPs please comment and help it would be greatly appreciated.


    Thursday, July 20, 2017 2:24 AM