Authenticate Queued Messages

Do queued messages automatically include session authentication object in the message metadata?

We’re using the built-in JWT provider for authentication and a custom AuthenticationAttribute for authorization and everything is working correctly for in-process requests, but any deferred messages via the queue are failing authentication.

How can we include the AuthSession (or equivalent) with each queued message so when the message is handled, it will contain the necessary session/auth information to pass our custom AuthenticationAttribute? Our AuthenticationAttribute implementation is decorated on every service method.

No queued messages just contain the serialized Request DTOs. We have a section in the Messaging Docs showing how to make Authenticate Requests via MQ however we’ve since added the IHasSessionId interface to enable Authentication within Request DTOs so it should also work if your Messages implement IHasSessionId and populate the SessionId property with the Users SessionId.