From 373a9c5eb2cbbb63b5936ddde8fa69d8969c8745 Mon Sep 17 00:00:00 2001 From: Thomas Levesque Date: Mon, 30 Jul 2018 13:57:23 +0200 Subject: [PATCH] Update default UI and samples to use provider display name --- .../Areas/Identity/Controllers/AccountController.cs | 2 +- .../Identity/Views/Account/ExternalLoginConfirmation.cshtml | 2 +- .../Areas/Identity/Views/Manage/ManageLogins.cshtml | 4 ++-- samples/IdentitySample.Mvc/Controllers/AccountController.cs | 2 +- .../Views/Account/ExternalLoginConfirmation.cshtml | 4 ++-- samples/IdentitySample.Mvc/Views/Manage/ManageLogins.cshtml | 4 ++-- src/UI/Areas/Identity/Pages/Account/ExternalLogin.cshtml | 4 ++-- src/UI/Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs | 6 +++--- .../Identity/Pages/Account/Manage/ExternalLogins.cshtml | 4 ++-- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Controllers/AccountController.cs b/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Controllers/AccountController.cs index 887f720dbd..c2968d6735 100644 --- a/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Controllers/AccountController.cs +++ b/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Controllers/AccountController.cs @@ -196,7 +196,7 @@ namespace IdentityOIDCWebApplicationSample.Identity.Controllers { // If the user does not have an account, then ask the user to create an account. ViewData["ReturnUrl"] = returnUrl; - ViewData["LoginProvider"] = info.LoginProvider; + ViewData["ProviderDisplayName"] = info.ProviderDisplayName; var email = info.Principal.FindFirstValue(ClaimTypes.Email); return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = email }); } diff --git a/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Views/Account/ExternalLoginConfirmation.cshtml b/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Views/Account/ExternalLoginConfirmation.cshtml index 77c8d1bdc2..6794e26d03 100644 --- a/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Views/Account/ExternalLoginConfirmation.cshtml +++ b/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Views/Account/ExternalLoginConfirmation.cshtml @@ -12,7 +12,7 @@

- You've successfully authenticated with @ViewData["LoginProvider"]. + You've successfully authenticated with @ViewData["ProviderDisplayName"]. Please enter an email address for this site below and click the Register button to finish logging in.

diff --git a/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Views/Manage/ManageLogins.cshtml b/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Views/Manage/ManageLogins.cshtml index 9e4cbcc9fb..b3de9cef05 100644 --- a/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Views/Manage/ManageLogins.cshtml +++ b/samples/IdentityOIDCWebApplicationSample/Areas/Identity/Views/Manage/ManageLogins.cshtml @@ -15,7 +15,7 @@ @for (var index = 0; index < Model.CurrentLogins.Count; index++) { - @Model.CurrentLogins[index].LoginProvider + @Model.CurrentLogins[index].ProviderDisplayName² @if ((bool)ViewData["ShowRemoveButton"]) { @@ -23,7 +23,7 @@
- +
} diff --git a/samples/IdentitySample.Mvc/Controllers/AccountController.cs b/samples/IdentitySample.Mvc/Controllers/AccountController.cs index ca996ea292..c1616a11f6 100644 --- a/samples/IdentitySample.Mvc/Controllers/AccountController.cs +++ b/samples/IdentitySample.Mvc/Controllers/AccountController.cs @@ -187,7 +187,7 @@ namespace IdentitySample.Controllers { // If the user does not have an account, then ask the user to create an account. ViewData["ReturnUrl"] = returnUrl; - ViewData["LoginProvider"] = info.LoginProvider; + ViewData["ProviderDisplayName"] = info.ProviderDisplayName; var email = info.Principal.FindFirstValue(ClaimTypes.Email); return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = email }); } diff --git a/samples/IdentitySample.Mvc/Views/Account/ExternalLoginConfirmation.cshtml b/samples/IdentitySample.Mvc/Views/Account/ExternalLoginConfirmation.cshtml index fcd3b18691..06aff0d966 100644 --- a/samples/IdentitySample.Mvc/Views/Account/ExternalLoginConfirmation.cshtml +++ b/samples/IdentitySample.Mvc/Views/Account/ExternalLoginConfirmation.cshtml @@ -4,7 +4,7 @@ }

@ViewData["Title"].

-

Associate your @ViewData["LoginProvider"] account.

+

Associate your @ViewData["ProviderDisplayName"] account.

Association Form

@@ -12,7 +12,7 @@

- You've successfully authenticated with @ViewData["LoginProvider"]. + You've successfully authenticated with @ViewData["ProviderDisplayName"]. Please enter a user name for this site below and click the Register button to finish logging in.

diff --git a/samples/IdentitySample.Mvc/Views/Manage/ManageLogins.cshtml b/samples/IdentitySample.Mvc/Views/Manage/ManageLogins.cshtml index 5fe5ed475e..1036a4f9e2 100644 --- a/samples/IdentitySample.Mvc/Views/Manage/ManageLogins.cshtml +++ b/samples/IdentitySample.Mvc/Views/Manage/ManageLogins.cshtml @@ -15,7 +15,7 @@ @for (var index = 0; index < Model.CurrentLogins.Count; index++) { - @Model.CurrentLogins[index].LoginProvider + @Model.CurrentLogins[index].ProviderDisplayName @if ((bool)ViewData["ShowRemoveButton"]) { @@ -23,7 +23,7 @@
- +
} diff --git a/src/UI/Areas/Identity/Pages/Account/ExternalLogin.cshtml b/src/UI/Areas/Identity/Pages/Account/ExternalLogin.cshtml index 132fedc536..3582ed0d5e 100644 --- a/src/UI/Areas/Identity/Pages/Account/ExternalLogin.cshtml +++ b/src/UI/Areas/Identity/Pages/Account/ExternalLogin.cshtml @@ -5,11 +5,11 @@ }

@ViewData["Title"]

-

Associate your @Model.LoginProvider account.

+

Associate your @Model.ProviderDisplayName account.


- You've successfully authenticated with @Model.LoginProvider. + You've successfully authenticated with @Model.ProviderDisplayName. Please enter an email address for this site below and click the Register button to finish logging in.

diff --git a/src/UI/Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs b/src/UI/Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs index f57f6c7ad4..34f90d3ce4 100644 --- a/src/UI/Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs +++ b/src/UI/Areas/Identity/Pages/Account/ExternalLogin.cshtml.cs @@ -20,7 +20,7 @@ namespace Microsoft.AspNetCore.Identity.UI.Pages.Account.Internal [BindProperty] public InputModel Input { get; set; } - public string LoginProvider { get; set; } + public string ProviderDisplayName { get; set; } public string ReturnUrl { get; set; } @@ -107,7 +107,7 @@ namespace Microsoft.AspNetCore.Identity.UI.Pages.Account.Internal { // If the user does not have an account, then ask the user to create an account. ReturnUrl = returnUrl; - LoginProvider = info.LoginProvider; + ProviderDisplayName = info.ProviderDisplayName; if (info.Principal.HasClaim(c => c.Type == ClaimTypes.Email)) { Input = new InputModel @@ -154,7 +154,7 @@ namespace Microsoft.AspNetCore.Identity.UI.Pages.Account.Internal } } - LoginProvider = info.LoginProvider; + ProviderDisplayName = info.ProviderDisplayName; ReturnUrl = returnUrl; return Page(); } diff --git a/src/UI/Areas/Identity/Pages/Account/Manage/ExternalLogins.cshtml b/src/UI/Areas/Identity/Pages/Account/Manage/ExternalLogins.cshtml index 8da18b5e17..2c87ab1593 100644 --- a/src/UI/Areas/Identity/Pages/Account/Manage/ExternalLogins.cshtml +++ b/src/UI/Areas/Identity/Pages/Account/Manage/ExternalLogins.cshtml @@ -14,7 +14,7 @@ @foreach (var login in Model.CurrentLogins) { - @login.LoginProvider + @login.ProviderDisplayName @if (Model.ShowRemoveButton) { @@ -22,7 +22,7 @@
- +
}