12 writes to Username
Microsoft.AspNetCore.Antiforgery (2)
Internal\DefaultAntiforgeryTokenGenerator.cs (1)
69requestToken.Username = authenticatedIdentity.Name;
Internal\DefaultAntiforgeryTokenSerializer.cs (1)
169deserializedToken.Username = username;
Microsoft.AspNetCore.Antiforgery.Microbenchmarks (3)
Benchmarks\AntiforgeryTokenGeneratorBenchmarks.cs (2)
49Username = string.Empty 64Username = "testuser@example.com"
Benchmarks\AntiforgeryTokenSerializerBenchmarks.cs (1)
30Username = "user@test.com",
Microsoft.AspNetCore.Antiforgery.Test (7)
AntiforgeryTokenTest.cs (2)
73token.Username = "my username"; 77token.Username = null;
DefaultAntiforgeryTokenGeneratorTest.cs (4)
396Username = embeddedUsername, 459Username = String.Empty, 496Username = String.Empty, 530Username = "THE-USER",
DefaultAntiforgeryTokenSerializerTest.cs (1)
145Username = "Jérôme",
14 references to Username
Microsoft.AspNetCore.Antiforgery (5)
Internal\DefaultAntiforgeryTokenGenerator.cs (3)
80&& string.IsNullOrEmpty(requestToken.Username) 169if (!comparer.Equals(requestToken.Username, currentUsername)) 171message = Resources.FormatAntiforgeryToken_UsernameMismatch(requestToken.Username, currentUsername);
Internal\DefaultAntiforgeryTokenSerializer.cs (2)
208var usernameByteCount = Encoding.UTF8.GetByteCount(token.Username!); 242offset += tokenBytes[offset..].Write7BitEncodedString(token.Username!);
Microsoft.AspNetCore.Antiforgery.Test (9)
AntiforgeryTokenTest.cs (3)
70Assert.Equal("", token.Username); 74Assert.Equal("my username", token.Username); 78Assert.Equal("", token.Username);
DefaultAntiforgeryTokenGeneratorTest.cs (4)
71Assert.Empty(fieldToken.Username); 136Assert.Empty(fieldToken.Username); 166Assert.Equal("", fieldToken.Username); 199Assert.Equal("my-username", fieldToken.Username);
DefaultAntiforgeryTokenSerializerTest.cs (2)
209Assert.Equal(expected.Username, actual.Username);