cancel
Showing results for 
Search instead for 
Did you mean: 

How to add "Audience" to the oauth token method used in charon integration

ameena_m
Explorer
314

Hi Experts,

I have used charon before to achieve API integrations and now in our new requirement we must send an additional parameter called "audience" along with the clientId and clientSecret.
Currently the oauth token method in charon only allows 4 parameters as mentioned below
@OAuth(clientId = "...", clientSecret = "...", scope = "...", url = "...")

I tried adding audience to the config map but it dint work.

Please suggest me on how to achieve this?
Thanks.
View Entire Topic
adamreisberg
Active Participant

Hi ameena_m

Unfortunately, you cannot extend the capability of the OAuth functionality on the Charon client in SAP Commerce Cloud, to the best of my knowledge.

sarbajeet
Explorer
0 Kudos

Thank you @ameena_m for the query.

Thank you @adamreisberg for the clarifications.

It does seem unusual that Charon's OAuth2 (ConsumedOAuthCredential) doesn't support standard parameters like `username`, `password`, and `grant_type`. Using WebClient for integration is indeed a good approach. It would be beneficial if the SAP Commerce product team could extend Charon to support these standard parameters as well as custom ones. This would make the integration process smoother and more flexible for various use cases.

adamreisberg
Active Participant
0 Kudos
Charon has its history tied to the YaaS (Hybris as a Service) model from around 2014/2015. It was one of the first declarative rest clients out there. If you are looking for a declarative rest client that is more full featured, I’d recommend looking at Feign client. As a caveat, I am not sure if Feign client is compatible with SAP Commerce’s Spring architecture.
sarbajeet
Explorer
0 Kudos
Thank you @adamreisberg for more clarity. My intent was to leverage the platform capabilities and have a standardized approach so that our team's development time can be reduced. For example, if I select FeignClient over Charon, I can't leverage any of the platform capabilities, like managing the configuration in Destination objects. So, I would prefer "WebClient" over FeignClient as the later one has blocking nature. Thanks once again for the quick response.