Expand my Community achievements bar.

SOLVED

External API activity - Authentication token

Avatar

Level 2

Hi,

 

I'm planning to send some data from ACS via External API activity to Dynamics 365, but Dynamics 365 authentication token expires every 1hr, I can't be able to send data out automatically (need to manually update the token after it expires). Could anyone please suggest what needs to be done to fetch new authentication token after expiration / after 1hr.

 

Thanks!

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Dharsanprakash,

 

I had a project in where we  implemented OAuth 2.0 client credentials flow, this what it does is that requests a new token from Azure before each API call from ACS. You might be able to cover it, by building a middleware endpoint that ACS can call. This middlepoint will handle token generation and will forward it the data to Dynamics 365, so in this way ACS doesn't deal with token expiration directly.

 

You can chech the following documentation on the External API activity in ACS:

External API Acs 

 

Hope it helps and if you need more information just let me know!

Best, 

Celia

 

 

View solution in original post

3 Replies

Avatar

Correct answer by
Community Advisor

Hi @Dharsanprakash,

 

I had a project in where we  implemented OAuth 2.0 client credentials flow, this what it does is that requests a new token from Azure before each API call from ACS. You might be able to cover it, by building a middleware endpoint that ACS can call. This middlepoint will handle token generation and will forward it the data to Dynamics 365, so in this way ACS doesn't deal with token expiration directly.

 

You can chech the following documentation on the External API activity in ACS:

External API Acs 

 

Hope it helps and if you need more information just let me know!

Best, 

Celia

 

 

Avatar

Level 2

Hi @ccg1706, thanks for your response, but I'm not sure how to set the middleware endpoint, could you please guide me on this, also in ACS document it is mentioned that redirect is not allowed in new update. I have attached screenshot for the reference.

 

Thanks!

Avatar

Community Advisor

@Dharsanprakash Dyanmics 365 should have an OAuth mechanism to connect from any external system. I would suggest getting the OAuth API credentials and configuring that as an external connection in ACS for the automatic exchange of tokens when they expire.

https://community.dynamics.com/forums/thread/details/?threadid=ec14d4d7-2c15-ee11-8f6e-000d3a4e5de0

https://experienceleague.adobe.com/en/docs/campaign-standard/using/administrating/application-settin...

 

Thanks, Sathees