We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f95922a commit 53bee9dCopy full SHA for 53bee9d
1 file changed
src/HttpClient.Cache/CacheKeyComputer.cs
@@ -114,6 +114,15 @@ public class CacheKeyComputer : ICacheKeyComputer
114
115
protected virtual string? GetUserId(JwtSecurityToken jwt)
116
{
117
- return jwt.Payload.Sub ?? jwt.Payload.GetValueOrDefault("client_id") as string;
+ if (jwt.Payload.Sub is not null)
118
+ {
119
+ return "sub:" + jwt.Payload.Sub;
120
+ }
121
+ else if (jwt.Payload.TryGetValue("client_id", out var clientId))
122
123
+ return "client_id:" + clientId;
124
125
+
126
+ return null;
127
}
128
0 commit comments