3 instantiations of AntiforgeryToken
Microsoft.AspNetCore.Antiforgery (3)
Internal\DefaultAntiforgeryTokenGenerator.cs (2)
27
return new
AntiforgeryToken
()
49
var requestToken = new
AntiforgeryToken
()
Internal\DefaultAntiforgeryTokenSerializer.cs (1)
93
var deserializedToken = new
AntiforgeryToken
();
55 references to AntiforgeryToken
Microsoft.AspNetCore.Antiforgery (47)
Internal\AntiforgeryFeature.cs (4)
13
public
AntiforgeryToken
? CookieToken { get; set; }
17
public
AntiforgeryToken
? RequestToken { get; set; }
22
public
AntiforgeryToken
? NewCookieToken { get; set; }
27
public
AntiforgeryToken
? NewRequestToken { get; set; }
Internal\DefaultAntiforgery.cs (13)
118
if (!TryDeserializeTokens(httpContext, tokens, out
var
deserializedCookieToken, out
var
deserializedRequestToken))
188
AntiforgeryToken
deserializedCookieToken;
189
AntiforgeryToken
deserializedRequestToken;
290
AntiforgeryToken
? cookieToken;
303
AntiforgeryToken
? newCookieToken;
322
private
AntiforgeryToken
? GetCookieTokenDoesNotThrow(HttpContext httpContext)
330
var
token = _tokenSerializer.Deserialize(serializedToken);
348
var
cookieToken = antiforgeryFeature.NewCookieToken ?? antiforgeryFeature.CookieToken;
432
[NotNullWhen(true)] out
AntiforgeryToken
? cookieToken,
433
[NotNullWhen(true)] out
AntiforgeryToken
? requestToken)
453
out
AntiforgeryToken
cookieToken,
454
out
AntiforgeryToken
requestToken)
Internal\DefaultAntiforgeryTokenGenerator.cs (7)
25
public
AntiforgeryToken
GenerateCookieToken()
35
public
AntiforgeryToken
GenerateRequestToken(
37
AntiforgeryToken
cookieToken)
49
var
requestToken = new AntiforgeryToken()
96
public bool IsCookieTokenValid(
AntiforgeryToken
? cookieToken)
104
AntiforgeryToken
cookieToken,
105
AntiforgeryToken
requestToken,
Internal\DefaultAntiforgeryTokenSerializer.cs (9)
29
public
AntiforgeryToken
Deserialize(string serializedToken)
52
var
token = Deserialize(reader);
84
private static
AntiforgeryToken
? Deserialize(BinaryReader reader)
93
var
deserializedToken = new AntiforgeryToken();
94
var securityTokenBytes = reader.ReadBytes(
AntiforgeryToken
.SecurityTokenBitLength / 8);
96
new BinaryBlob(
AntiforgeryToken
.SecurityTokenBitLength, securityTokenBytes);
104
var claimUidBytes = reader.ReadBytes(
AntiforgeryToken
.ClaimUidBitLength / 8);
105
deserializedToken.ClaimUid = new BinaryBlob(
AntiforgeryToken
.ClaimUidBitLength, claimUidBytes);
125
public string Serialize(
AntiforgeryToken
token)
Internal\IAntiforgeryFeature.cs (4)
8
AntiforgeryToken
? CookieToken { get; set; }
18
AntiforgeryToken
? NewCookieToken { get; set; }
22
AntiforgeryToken
? NewRequestToken { get; set; }
26
AntiforgeryToken
? RequestToken { get; set; }
Internal\IAntiforgeryTokenGenerator.cs (8)
17
/// <returns>An <see cref="
AntiforgeryToken
"/>.</returns>
18
AntiforgeryToken
GenerateCookieToken();
25
/// <returns>An <see cref="
AntiforgeryToken
"/>.</returns>
26
AntiforgeryToken
GenerateRequestToken(HttpContext httpContext,
AntiforgeryToken
cookieToken);
33
bool IsCookieTokenValid(
AntiforgeryToken
? cookieToken);
47
AntiforgeryToken
cookieToken,
48
AntiforgeryToken
requestToken,
Internal\IAntiforgeryTokenSerializer.cs (2)
9
AntiforgeryToken
Deserialize(string serializedToken);
10
string Serialize(
AntiforgeryToken
token);
Microsoft.AspNetCore.Antiforgery.Test (8)
DefaultAntiforgeryTokenGeneratorTest.cs (5)
24
var
token = tokenProvider.GenerateCookieToken();
64
var
fieldToken = tokenProvider.GenerateRequestToken(httpContext, cookieToken);
129
var
fieldToken = tokenProvider.GenerateRequestToken(httpContext, cookieToken);
164
var
fieldToken = tokenProvider.GenerateRequestToken(httpContext, cookieToken);
197
var
fieldToken = tokenProvider.GenerateRequestToken(httpContext, cookieToken);
DefaultAntiforgeryTokenSerializerTest.cs (3)
77
var
deserializedToken = testSerializer.Deserialize(actualSerializedData);
108
var
deserializedToken = testSerializer.Deserialize(actualSerializedData);
132
var
deserializedToken = testSerializer.Deserialize(actualSerializedData);