Web service how can we use beforerule for account aggregation

Hi, Can someone please provide your input on below query:

I have one web service where account aggregation is using json api which require bearer token which get generated at run time. here I am looking to use some rule which can give new bearer token each time for account aggregation activity.

I am able to create an account for web service connector service using before rule. I am generating jwt token during create account operation which is internally done by before rule.

Could you please suggest me how can I have access token assigned to http operation like account aggregation and entitlement aggregation.

@hranjan3
If you choose the Authentication Method as API Token and keep token value, by default it would be passed to http headers under “Authorization” key, value as “Bearer (your token value)”.
However, it depends on how webservice API Call is taking input. Example, if your API EndPoint need header ‘Autorization’ and value as just ‘Token’ (Without Bearer) then you need to manipulate as below

1 Like

Hi

I wouldnt use the Before Rule.

I would create an HTTP Operation for Custom authentication to return the jwt token, then use that in the account aggregation http operation.

Hi @hranjan3,

You have written the rule for token generation under that rule only write the logic for create operation or account aggregation and try.

Thanks

Hi Himanshu,

For account aggregation or entitlement aggregation, you can write a before-operation rule specifically for token generation and patch that rule to both HTTPS operations at their respective index numbers. This will generate a new token every time when the account or entitlement aggregation is triggered.

Thanks.

6 Likes

Hi @Rohit_Sahu and All, thanks for your input. it worked for me. I used beforeRule in account aggregation section.