Skip to content

Commit f83817e

Browse files
Use new RNG.GetBytes() function (#27792)
1 parent ae0ae69 commit f83817e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/SignalR/samples/JwtSample/Startup.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,9 @@ namespace JwtSample
1818
{
1919
public class Startup
2020
{
21-
private readonly SymmetricSecurityKey SecurityKey;
21+
private readonly SymmetricSecurityKey SecurityKey = new SymmetricSecurityKey(RandomNumberGenerator.GetBytes(16));
2222
private readonly JwtSecurityTokenHandler JwtTokenHandler = new JwtSecurityTokenHandler();
2323

24-
public Startup()
25-
{
26-
var key = new byte[16];
27-
RandomNumberGenerator.Fill(key);
28-
SecurityKey = new SymmetricSecurityKey(key);
29-
}
30-
3124
public void ConfigureServices(IServiceCollection services)
3225
{
3326
services.AddSignalR();

0 commit comments

Comments
 (0)