Community
Showing results for 
Search instead for 
Do you mean 
Reply

ACT Webhook Messenger in a multi-tenant environment

Highlighted
Copper Contributor
Posts: 36
Country: United_Kingdom

ACT Webhook Messenger in a multi-tenant environment

We’re attempting to use webhooks in a multi-tenant environment, I initially logged this one with support and was told it might be an authentication issue with the API but we’re able to authenticate successfully without any issues. When the first webhook is registered the Act! WebHook Messenger service fails to start, it looks like there’s a problem with this service. I’ve included the log files below. This is also happening on v21 SP1.

 

The webhook-notifications log file logs the following:

 

2020-01-17 13:14:08,123 [1] DEBUG Act.Webhook.Notifications.ActWebHookMessengerService - AUTO MODIFICATIONS COMPLETED -----

2020-01-17 13:14:08,123 [1] DEBUG Act.Webhook.Notifications.ActWebHookMessengerService -

2020-01-17 13:14:08,123 [1] DEBUG Act.Webhook.Notifications.ActWebHookMessengerService - The service setup has completed its configuration.

2020-01-17 13:14:08,139 [1] DEBUG Act.Webhook.Notifications.ActWebHookMessengerService - Constructor ActWebHookMessengerService(): pollingInterval: 60, pollingRetryInterval: 120, cachingInterval: 7200, retryStartInterval: 86400, retryAttempts: 3, retryStartAttempts: 3, threadParallelism: 4, alarmQueueSize: 6000

2020-01-17 13:14:08,232 [12] INFO Act.Webhook.Notifications.ActWebHookMessengerService - OnStart: Started the Act! Webhook Messaging Service.

2020-01-17 13:14:08,248 [12] DEBUG Act.Webhook.Notifications.ActWebHookMessengerService - GetRegistration(): Registration cache has not been created or has expired.

2020-01-17 13:14:08,248 [12] DEBUG Act.Webhook.Notifications.ActWebHookMessengerService - GetRegistration(): Rebuilding cache...

2020-01-17 13:14:08,498 [12] DEBUG Act.Webhook.Notifications.ActWebHookMessengerService - GetRegistration(): Cached: True.  Total of 1 registrations in cache.

2020-01-17 13:14:08,498 [12] INFO Act.Webhook.Notifications.ActWebHookMessengerService - GetSymmetricKeyFromFile(): Tenant symmetric key does not exists.  Default to APFW settings.

2020-01-17 13:14:08,498 [12] DEBUG Act.Webhook.Notifications.ActWebHookMessengerService - GetSymmetricKeyFromFile(): Tenant symmetric key successfully loaded: Total Tenants: 1

2020-01-17 13:14:18,187 [12] ERROR Act.Webhook.Notifications.ActWebHookMessengerService - Token Exception: Unable to generate token.

System.Exception: Token Failure: HTTP StatusCode:Unauthorized was sent when requesting a token.

   at Act.Webhook.Notifications.ActWebHookMessengerService.GetToken(HttpClient client, Registration registration) in c:\gitroot\act.webhook.notifications\act.webhook.notifications\ActWebHookMessengerService.cs:line 439

 

The ACT! Web API log in Windows Event Viewer also logs two errors when trying to start the service:

1)

2020-01-17 13:46:49,065 [9  ] ERROR [(null)] - Authorization Exception: Unhandled exception.

Microsoft.IdentityModel.Tokens.SecurityTokenInvalidSignatureException: IDX10503: Signature validation failed. Keys tried: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.

Exceptions caught:

'[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.

token: '[PII is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.

   at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateSignature(String token, TokenValidationParameters validationParameters)

   at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateToken(String token, TokenValidationParameters validationParameters, SecurityToken& validatedToken)

   at act.web.api.Internal.Extensions.Types.x509.TypeExtensions.CertificateClaims(AuthenticationHeaderValue header, String certificatePath) in c:\gitroot\act.web.api\act.web.api\Internal\Extensions\Types\x509\TypeExtensions.AuthorizationHeaderValue.cs:line 27

   at act.web.api.Security.AuthMessageHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in c:\gitroot\act.web.api\act.web.api\Security\AuthMessageHandler.cs:line 179

 

2)

2020-01-17 13:46:49,096 [11 ] ERROR [(null)] - Token Exception: Unable to generate token.

System.Exception: Token Failure: HTTP StatusCode:Unauthorized was sent when requesting a token.

   at Act.Webhook.Notifications.ActWebHookMessengerService.GetToken(HttpClient client, Registration registration) in c:\gitroot\act.webhook.notifications\act.webhook.notifications\ActWebHookMessengerService.cs:line 439

 

Have you had anything on the webhooks logged by other business partners?

 

Thanks

Highlighted
Employee
Posts: 215
Country: USA

Re: ACT Webhook Messenger in a multi-tenant environment

Greg,

 

I appreciate you posting the feedback for the issue related to the Webhooks service. The Webhooks components and feature set is an area that is still in development, and an area we will be making updates to throughout this year. The service is available, but we have not formalized a public release and consumption of Webhooks documentation as of yet. The main use case that Webhooks was built for originally was to help manage the Act! notification micro-service, and then would scale out for public consumption. 

 

I have captured the details and error listed above, and will make sure to get this in front of the team. When we have an update to this available for beta, I will make sure that this thread is updated and you have access to the build. 

 

I don't have a firm update for when this will be available, but will make sure this thread gets updated when there changes.

 

Regards, 

Jeff Hanrahan

Highlighted
Employee
Posts: 215
Country: USA

Re: ACT Webhook Messenger in a multi-tenant environment

In the meantime, if you need a workaround to get this up and running until there is an update to the Webhooks feature you can do the following:

 

If the web-hooks service will not start, the reason is because the Act! database that had web-hook registrations for it was deleted.  So when the service tries to start it will try to validate each registration, but since the database no longer exists, it would give an authentication error.

 

Resolution:

Delete all registrations from the WebHooks database that do not have an active Act database.  If they are in development, they can just delete the WEBHOOKS database and then start the service.  It will recreate the database for them.

 

Regards,

Jeff Hanrahan