Fix SignIn params order.
This commit is contained in:
parent
b54ba17e92
commit
48ae50ab67
|
|
@ -27,6 +27,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{58D9
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "IdentitySample.Mvc", "samples\IdentitySample.Mvc\IdentitySample.Mvc.kproj", "{E1BFA023-CFFD-49CE-8466-1C28DD2EC1F6}"
|
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "IdentitySample.Mvc", "samples\IdentitySample.Mvc\IdentitySample.Mvc.kproj", "{E1BFA023-CFFD-49CE-8466-1C28DD2EC1F6}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{970CAB07-F853-4712-AA12-BD8961C8E430}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
global.json = global.json
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ namespace Microsoft.AspNet.Identity.Authentication
|
||||||
|
|
||||||
public void SignIn(ClaimsIdentity identity, bool isPersistent)
|
public void SignIn(ClaimsIdentity identity, bool isPersistent)
|
||||||
{
|
{
|
||||||
Context.Response.SignIn(identity, new AuthenticationProperties { IsPersistent = isPersistent });
|
Context.Response.SignIn(new AuthenticationProperties() { IsPersistent = isPersistent }, identity);
|
||||||
}
|
}
|
||||||
public void SignOut(string authenticationType)
|
public void SignOut(string authenticationType)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ namespace Microsoft.AspNet.Identity.Authentication.Test
|
||||||
var context = new Mock<HttpContext>();
|
var context = new Mock<HttpContext>();
|
||||||
var response = new Mock<HttpResponse>();
|
var response = new Mock<HttpResponse>();
|
||||||
context.Setup(c => c.Response).Returns(response.Object).Verifiable();
|
context.Setup(c => c.Response).Returns(response.Object).Verifiable();
|
||||||
response.Setup(r => r.SignIn(It.IsAny<ClaimsIdentity>(), It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent))).Verifiable();
|
response.Setup(r => r.SignIn(It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent), It.IsAny<ClaimsIdentity>())).Verifiable();
|
||||||
var contextAccessor = new Mock<IContextAccessor<HttpContext>>();
|
var contextAccessor = new Mock<IContextAccessor<HttpContext>>();
|
||||||
contextAccessor.Setup(a => a.Value).Returns(context.Object);
|
contextAccessor.Setup(a => a.Value).Returns(context.Object);
|
||||||
var roleManager = MockHelpers.MockRoleManager<TestRole>();
|
var roleManager = MockHelpers.MockRoleManager<TestRole>();
|
||||||
|
|
@ -176,7 +176,7 @@ namespace Microsoft.AspNet.Identity.Authentication.Test
|
||||||
manager.Setup(m => m.CheckPasswordAsync(user, "password", CancellationToken.None)).ReturnsAsync(true).Verifiable();
|
manager.Setup(m => m.CheckPasswordAsync(user, "password", CancellationToken.None)).ReturnsAsync(true).Verifiable();
|
||||||
var context = new Mock<HttpContext>();
|
var context = new Mock<HttpContext>();
|
||||||
var response = new Mock<HttpResponse>();
|
var response = new Mock<HttpResponse>();
|
||||||
response.Setup(r => r.SignIn(It.IsAny<ClaimsIdentity>(), It.IsAny<AuthenticationProperties>())).Verifiable();
|
response.Setup(r => r.SignIn(It.IsAny<AuthenticationProperties>(), It.IsAny<ClaimsIdentity>())).Verifiable();
|
||||||
context.Setup(c => c.Response).Returns(response.Object).Verifiable();
|
context.Setup(c => c.Response).Returns(response.Object).Verifiable();
|
||||||
var contextAccessor = new Mock<IContextAccessor<HttpContext>>();
|
var contextAccessor = new Mock<IContextAccessor<HttpContext>>();
|
||||||
contextAccessor.Setup(a => a.Value).Returns(context.Object);
|
contextAccessor.Setup(a => a.Value).Returns(context.Object);
|
||||||
|
|
@ -245,7 +245,7 @@ namespace Microsoft.AspNet.Identity.Authentication.Test
|
||||||
manager.Setup(m => m.GetUserNameAsync(user, CancellationToken.None)).ReturnsAsync(user.UserName).Verifiable();
|
manager.Setup(m => m.GetUserNameAsync(user, CancellationToken.None)).ReturnsAsync(user.UserName).Verifiable();
|
||||||
var context = new Mock<HttpContext>();
|
var context = new Mock<HttpContext>();
|
||||||
var response = new Mock<HttpResponse>();
|
var response = new Mock<HttpResponse>();
|
||||||
response.Setup(r => r.SignIn(It.IsAny<ClaimsIdentity>(), It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent))).Verifiable();
|
response.Setup(r => r.SignIn(It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent), It.IsAny<ClaimsIdentity>())).Verifiable();
|
||||||
context.Setup(c => c.Response).Returns(response.Object).Verifiable();
|
context.Setup(c => c.Response).Returns(response.Object).Verifiable();
|
||||||
var id = new ClaimsIdentity(HttpAuthenticationManager.TwoFactorUserIdAuthenticationType);
|
var id = new ClaimsIdentity(HttpAuthenticationManager.TwoFactorUserIdAuthenticationType);
|
||||||
id.AddClaim(new Claim(ClaimTypes.Name, user.Id));
|
id.AddClaim(new Claim(ClaimTypes.Name, user.Id));
|
||||||
|
|
@ -311,7 +311,7 @@ namespace Microsoft.AspNet.Identity.Authentication.Test
|
||||||
var context = new Mock<HttpContext>();
|
var context = new Mock<HttpContext>();
|
||||||
var response = new Mock<HttpResponse>();
|
var response = new Mock<HttpResponse>();
|
||||||
context.Setup(c => c.Response).Returns(response.Object).Verifiable();
|
context.Setup(c => c.Response).Returns(response.Object).Verifiable();
|
||||||
response.Setup(r => r.SignIn(It.Is<ClaimsIdentity>(i => i.AuthenticationType == ClaimsIdentityOptions.DefaultAuthenticationType), It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent))).Verifiable();
|
response.Setup(r => r.SignIn(It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent), It.Is<ClaimsIdentity>(i => i.AuthenticationType == ClaimsIdentityOptions.DefaultAuthenticationType))).Verifiable();
|
||||||
var id = new ClaimsIdentity(HttpAuthenticationManager.TwoFactorRememberedAuthenticationType);
|
var id = new ClaimsIdentity(HttpAuthenticationManager.TwoFactorRememberedAuthenticationType);
|
||||||
id.AddClaim(new Claim(ClaimTypes.Name, user.Id));
|
id.AddClaim(new Claim(ClaimTypes.Name, user.Id));
|
||||||
var authResult = new AuthenticationResult(id, new AuthenticationProperties(), new AuthenticationDescription());
|
var authResult = new AuthenticationResult(id, new AuthenticationProperties(), new AuthenticationDescription());
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ namespace Microsoft.AspNet.Identity.InMemory.Test
|
||||||
var context = new Mock<HttpContext>();
|
var context = new Mock<HttpContext>();
|
||||||
var response = new Mock<HttpResponse>();
|
var response = new Mock<HttpResponse>();
|
||||||
context.Setup(c => c.Response).Returns(response.Object).Verifiable();
|
context.Setup(c => c.Response).Returns(response.Object).Verifiable();
|
||||||
response.Setup(r => r.SignIn(It.IsAny<ClaimsIdentity>(), It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent))).Verifiable();
|
response.Setup(r => r.SignIn(It.Is<AuthenticationProperties>(v => v.IsPersistent == isPersistent), It.IsAny<ClaimsIdentity>())).Verifiable();
|
||||||
var contextAccessor = new Mock<IContextAccessor<HttpContext>>();
|
var contextAccessor = new Mock<IContextAccessor<HttpContext>>();
|
||||||
contextAccessor.Setup(a => a.Value).Returns(context.Object);
|
contextAccessor.Setup(a => a.Value).Returns(context.Object);
|
||||||
app.UseServices(services =>
|
app.UseServices(services =>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue