From d040dabc032a6656eb13500505d030a84afe6fad Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Fri, 17 Aug 2018 12:56:49 -0700 Subject: [PATCH] Allow QR AuthenticatorIssuer to be configurable --- src/Core/TokenOptions.cs | 5 +++++ .../Pages/Account/Manage/EnableAuthenticator.cshtml.cs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Core/TokenOptions.cs b/src/Core/TokenOptions.cs index 8c969769a1..45f0291ea3 100644 --- a/src/Core/TokenOptions.cs +++ b/src/Core/TokenOptions.cs @@ -75,5 +75,10 @@ namespace Microsoft.AspNetCore.Identity /// The used to validate two factor sign ins with an authenticator. /// public string AuthenticatorTokenProvider { get; set; } = DefaultAuthenticatorProvider; + + /// + /// Gets or sets the issuer used for the authenticator issuer. + /// + public string AuthenticatorIssuer { get; set; } = "Microsoft.AspNetCore.Identity.UI"; } } \ No newline at end of file diff --git a/src/UI/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs b/src/UI/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs index 5e5bb89445..c0c2975218 100644 --- a/src/UI/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs +++ b/src/UI/Areas/Identity/Pages/Account/Manage/EnableAuthenticator.cshtml.cs @@ -156,7 +156,7 @@ namespace Microsoft.AspNetCore.Identity.UI.Pages.Account.Manage.Internal { return string.Format( AuthenticatorUriFormat, - _urlEncoder.Encode("Microsoft.AspNetCore.Identity.UI"), + _urlEncoder.Encode(_userManager.Options.Tokens.AuthenticatorIssuer), _urlEncoder.Encode(email), unformattedKey); }