EWS OAuth request error

0 votes
asked Sep 6 by PierreB (180 points)

Hello,

I'm using Rebex Mail with Windev 26.

I use windev's native fonctions to retrieve a token from Microsoft.

I'm able to read the user's profile in Windev, I think my token is good.

When I use the received token with ews.login, I receive an exception error 400 bad request

Somebody have an idea ? Ask if you need the complete trace

Thanks in advance for any help

Pierre

Applies to: Rebex Secure Mail

2 Answers

+1 vote
answered Sep 7 by Pavel Matyska (14,940 points)
selected Sep 7 by PierreB
 
Best answer

The OAuth token Pierre shared with us on support@rebex.net has been encoded in Unicode string (2 bytes per character). Sending that token in ASCII encoding (1 byte per character) resolved that issue.

0 votes
answered Sep 6 by Pavel Matyska (14,940 points)

Hello,

do you process your token somehow before using it in Ews.Login method? Can you please share your token (base64 form) with us? You can see what your token contains on this site: https://jwt.ms/

From the "400 bad request" response I would say you are using bad token (recived form unsupported source) or a token in a bad form. I could not tell more without seeing the token and how it is used.

asked Sep 6 by PierreB (180 points) How to share my token
...