30 references to AuthorizeAsync
Microsoft.AspNetCore.Authorization.Test (30)
DefaultAuthorizationServiceTests.cs (29)
44var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 65var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 87var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 107var allowed = await authorizationService.AuthorizeAsync(new ClaimsPrincipal(), "Custom"); 134var allowed = await authorizationService.AuthorizeAsync(new ClaimsPrincipal(), "Custom"); 185var allowed = await authorizationService.AuthorizeAsync(new ClaimsPrincipal(), "Custom"); 214var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 236var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 257var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 276var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 305var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 326var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 473var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 501var allowed = await authorizationService.AuthorizeAsync(user, "Hao"); 527var allowed = await authorizationService.AuthorizeAsync(user, "Hao"); 549var allowed = await authorizationService.AuthorizeAsync(user, "Hao"); 571var allowed = await authorizationService.AuthorizeAsync(user, "Hao"); 970var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 989var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 1028var allowed = await authorizationService.AuthorizeAsync(user, "Basic"); 1068Assert.False((await authorizationService.AuthorizeAsync(user, "0")).Succeeded); 1069Assert.True((await authorizationService.AuthorizeAsync(user, "1")).Succeeded); 1070Assert.True((await authorizationService.AuthorizeAsync(user, "2")).Succeeded); 1071Assert.False((await authorizationService.AuthorizeAsync(user, "3")).Succeeded); 1087var result = await authorizationService.AuthorizeAsync(null, "Fail"); 1128Assert.False((await authorizationService.AuthorizeAsync(null, "Success")).Succeeded); 1147Assert.False((await authorizationService.AuthorizeAsync(null, "Success")).Succeeded); 1211var result = await authorizationService.AuthorizeAsync(user, "Log"); 1245var result = await authorizationService.AuthorizeAsync(user, "Log");
PassThroughAuthorizationHandlerTests.cs (1)
41var allowed = await authorizationService.AuthorizeAsync(new ClaimsPrincipal(), "Self");