Hi @victorpantoja, this could suggest a missing query parameter or scope. Several services won’t issue refresh tokens unless the correct values are provided. I don’t know about Dynamics CRM specifically, but for other Microsoft APIs the offline_access scope would be required for refresh tokens to be issued.
That said, it can be tricky to get this right and one major limitation of n8n is that it doesn’t provide much user-facing information on the OAuth2 process (we have an open bug ticket for this as ADO-147, but I don’t know when or if it will be picked up unfortunately), so you might need to test a few different settings for the time being.
This post would have a few relevant settings that worked for me (and ultimately also @0101binary0101) when connecting to Exchange/Outlook365 which might help you with getting started as well.
I had already given this permission in Azure. It seems that the token is simply not getting refreshed. I have to manually reconnect my account every 3600s, which of course is not what we want. Maybe I need to set something as “Auth URI Query Parameters”?