Merge pull request #11 from scottaddie/scottaddie/cookies-auth-scheme

Replace hard-coded string with constant
This commit is contained in:
Hao Kung 2017-12-12 15:14:43 -08:00 committed by GitHub
commit 20e2fe5ee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Mvc;
namespace AuthSamples.ClaimsTransformer.Controllers
@ -36,7 +37,7 @@ namespace AuthSamples.ClaimsTransformer.Controllers
new Claim("role", "Member")
};
await HttpContext.SignInAsync(new ClaimsPrincipal(new ClaimsIdentity(claims, "Cookies", "user", "role")));
await HttpContext.SignInAsync(new ClaimsPrincipal(new ClaimsIdentity(claims, CookieAuthenticationDefaults.AuthenticationScheme, "user", "role")));
if (Url.IsLocalUrl(returnUrl))
{