none
[EWS] [OAUTH] Cannot get access token RRS feed

  • Question

  • I am attempting to use OAuth2 to access an Exchange mailbox, but I'm having trouble with the OAuth protocol. I'm not using a library, just making direct http calls (using libcurl). Using documentation found here: https://docs.microsoft.com/en-us/outlook/rest/get-started.

    I have successfully obtained the authorization code, now I'm trying to use that to obtain the access token.  The response in the returned json is "invalid grant, Transmission data parser failure: Authorization Code is malformed or invalid.". Below is the data that I'm posting (the password is changed):

    grant_type=authorization_code&code=OAQABAAIAAAA9kTklhVy7SJTGAzR-p1BcCbuoT6J8og7Vdemw8a80l-rr0C8VXXM2SixI-fXy8ywlL1H0SJyUAMJ3GVD3T_I6FIkwmwcAcM1AGusoaZ75pUTMcbr5bqUnK7baYw5jksqUthWhV_HH1PRef78IlNUYB8Aiytt610KT1gMiqKYv_dEtutzWmooi&redirect_uri=https%3A%2F%2Flogin.microsoftonline.com%2Fcommon%2Foauth2%2Fnativeclient&client_id=f3f92d23-29dd-4465-828e-35300884ef61&client_secret=XXXXXXXXX
    Any ideas on why I'm getting this error?


    Jeffrey McKay

    Tuesday, August 8, 2017 11:53 PM