Browse Source

Improved hard-coded AuthenticationType.

pull/2670/head
Galip Tolga Erdem 7 years ago
parent
commit
b5cb8a5808
  1. 4
      framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs

4
framework/src/Volo.Abp.AspNetCore.Mvc/Volo/Abp/AspNetCore/Mvc/Authentication/ChallengeAccountController.cs

@ -8,10 +8,12 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication
public abstract class ChallengeAccountController : AbpController public abstract class ChallengeAccountController : AbpController
{ {
protected string[] ChallengeAuthenticationSchemas { get; } protected string[] ChallengeAuthenticationSchemas { get; }
protected string AuthenticationType { get; }
protected ChallengeAccountController(string[] challengeAuthenticationSchemas = null) protected ChallengeAccountController(string[] challengeAuthenticationSchemas = null)
{ {
ChallengeAuthenticationSchemas = challengeAuthenticationSchemas ?? new[] { "oidc" }; ChallengeAuthenticationSchemas = challengeAuthenticationSchemas ?? new[] { "oidc" };
AuthenticationType = "Identity.Application";
} }
[HttpGet] [HttpGet]
@ -42,7 +44,7 @@ namespace Volo.Abp.AspNetCore.Mvc.Authentication
{ {
await HttpContext.SignOutAsync().ConfigureAwait(false); await HttpContext.SignOutAsync().ConfigureAwait(false);
if (HttpContext.User.Identity.AuthenticationType == "Identity.Application") if (HttpContext.User.Identity.AuthenticationType == AuthenticationType)
{ {
return RedirectSafely(returnUrl, returnUrlHash); return RedirectSafely(returnUrl, returnUrlHash);
} }

Loading…
Cancel
Save