The ApplicationInsights-JS SDK supports a method called setAuthenticatedUserContext which sends a custom auth token with each event.
The client code is basically just doing some validation then updating the ai.user.authUserId tag.
On the server, it looks like the same thing can be done, but is not documented:
let client = appInsights.defaultClient;
let key = client.context.keys.userAuthUserId;
client.context.tags[key] = <authToken>;
Providing this same method on the server side would be helpful for several reasons:
- A users client and server activity can be tied together by the custom auth id
- SDK users don't have to figure this out themselves
- SDK consistency
The ApplicationInsights-JS SDK supports a method called
setAuthenticatedUserContextwhich sends a custom auth token with each event.The client code is basically just doing some validation then updating the
ai.user.authUserIdtag.On the server, it looks like the same thing can be done, but is not documented:
Providing this same method on the server side would be helpful for several reasons: