Out of the tokens issued by Thinktecture IdentityServer4, there is one called sid - the session id. In my application, I would like to link this id with some of my other logics. But I am not sure if I can assume it's always a GUID string. I tested a few. They are all valid GUIDs. Just wondering if my assumption is right.
Asked
Active
Viewed 381 times
1 Answers
0
I looked into the source code of IdentityServer4 and found out the sid is generated by:
public static string CreateUniqueId(int length = 16)
{
var bytes = new byte[length];
new RNGCryptoServiceProvider().GetBytes(bytes);
return ByteArrayToString(bytes);
}
According to this link, the result can be parsed as a GUID.

John Cheng
- 197
- 2
- 8