Solved Dynamics CRM Integration Token expiring

Status
Not open for further replies.

Alldayrr

Customer
Joined
Nov 22, 2017
Messages
32
Reaction score
2
Did 3CX change something on their latest update? For some reason, when i authorize on 3CX, the test succeeds. Then a minute later, I get this error. I even tried creating another app registration but get the same error after a minute. Seems the Token doesn't stick.

Screenshot 2023-02-07 at 12.06.19 PM.png
 
Please note that this error message is created from the CRM side. In general the refresh token is stored in the PBX but only the CRM can identify the expiration. When there is an authentication the PBX will sent the token that has stored and the CRM will identify, if it is expired or not in order to send the new refresh.
This error indicates issues issues with your account and not 3CX related.
 
  • Like
Reactions: edossantos
This is not something that you configure in the Dynamics as currently this is how the connections works.
The guideline is tested and there is no issue with the integration.
 
  • Like
Reactions: edossantos
So with that said, why would i get an expired token from CRM if it's configured as in guideline. It works for a minute and then no longer works. Everything was working fine until the latest updated to 18.0 build 6. So I think there's some bug in 3CX.
 
I have just tested on my side and i working as expected without any issue.
I would suggest that you create it from scratch.
 
  • Like
Reactions: edossantos
Ok interesting. Let me try again. Thanks for confirming. It's just weird that the token expires when we can't even control that.
 
Hmm. I started from scratch and same issue. I get this error after a minute after i connect and get it to work. Did you validate that it continues to work after one minute of authorizing?

tarted scenario with empty id
Started Auth
Request text: https://login.microsoftonline.com/c2eda368-2453-40..../oauth2/token
Request form value refresh_token set to 0.AQ0AaKPtwlMktUCm-HHT0YfUOLguzh8WPuklDkVl9zO1lXFdFsA..
Request form value grant_type set to refresh_token
Request form value client_id set to 4f61f753-c3a8-.....
Request form value resource set to https://arklign.crm.dynamics.com
System.Exception: Server returned a non successful status code - HTTPStatusCode=BadRequest - Reason=Bad Request - Content={"error":"invalid_grant","error_description":"AADSTS70000: Provided grant is invalid or malformed.\r\nTrace ID: 9081e3a7-d397-48a1-a207-357f28094501\r\nCorrelation ID: 3bc4e042-d350-4c89-96f5-77fc9406af5c\r\nTimestamp: 2023-02-07 21:05:40Z","error_codes":[70000],"timestamp":"2023-02-07 21:05:40Z","trace_id":"9081e3a7-d397-48a1-a207-357f28094501","correlation_id":"3bc4e042-d350-4c89-96f5-77fc9406af5c","error_uri":"https://login.microsoftonline.com/error?code=70000"}
at CrmIntegration.ScenarioProcessorBase.ProcessRequest(ScenarioRequest request, IValueManager customManager, HttpClient client, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
at CrmIntegration.ScenarioAuthHttpClientProvider.PerformScenarioIfNeeded(CancellationToken token)
at CrmIntegration.ScenarioAuthHttpClientProvider.Create(CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.ProcessScenario(ProtocolScenario scenario, IValueManager customManager, CancellationToken token)
at CrmIntegration.ScenarioProcessorBase.Execute(ProtocolScenario scenario, CancellationToken token)
at CrmIntegration.CrmProcessor.GetContactInfoFromCrm(List`1 result, IEnumerable`1 scenariosToProcess, IValueManager customManager, Func`2 filterResultsFunctor, Func`1 createContactRecordFunctor, CancellationToken token)
at CrmIntegration.CrmProcessor.GetContactInfo(String contactNumber, InteractionTypes interactionType, CancellationToken token)
 
Oh brain fart! I think i found out issue. After i authorize and test, I click away and forget to click ok to save the new authorize token. *sigh* Sorry to waste your time. It's been a rough week.
 
  • Like
Reactions: edossantos
Great news, glad to know this issue has been resolved.
 
  • Like
Reactions: edossantos
Status
Not open for further replies.

Forum statistics

Threads
112,322
Messages
591,889
Members
165,470
Latest member
Robert Lee