diff --git a/src/Services/Identity/Identity.API/Controllers/AccountController.cs b/src/Services/Identity/Identity.API/Controllers/AccountController.cs
index 7a1fea312..6e9bbce16 100644
--- a/src/Services/Identity/Identity.API/Controllers/AccountController.cs
+++ b/src/Services/Identity/Identity.API/Controllers/AccountController.cs
@@ -20,7 +20,7 @@ using Microsoft.Extensions.Logging;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
{
///
- /// This sample controller implements a typical login/logout/provision workflow for local and external accounts.
+ /// This sample controller implements a typical login/logout/provision workflow for local accounts.
/// The login service encapsulates the interactions with the user data store. This data store is in-memory only and cannot be used for production!
/// The interaction service provides a way for the UI to communicate with identityserver for validation and context retrieval
///
@@ -58,8 +58,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
var context = await _interaction.GetAuthorizationContextAsync(returnUrl);
if (context?.IdP != null)
{
- // if IdP is passed, then bypass showing the login screen
- return ExternalLogin(context.IdP, returnUrl);
+ throw new NotImplementedException("External login is not implemented!");
}
var vm = await BuildLoginViewModelAsync(returnUrl, context);
@@ -209,7 +208,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
}
catch (Exception ex)
{
- _logger.LogCritical(ex.Message);
+ _logger.LogError(ex, "LOGOUT ERROR: {ExceptionMessage}", ex.Message);
}
}
@@ -238,28 +237,6 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Controllers
return Redirect(redirectUrl);
}
- ///
- /// initiate roundtrip to external authentication provider
- ///
- [HttpGet]
- public IActionResult ExternalLogin(string provider, string returnUrl)
- {
- if (returnUrl != null)
- {
- returnUrl = UrlEncoder.Default.Encode(returnUrl);
- }
- returnUrl = "/account/externallogincallback?returnUrl=" + returnUrl;
-
- // start challenge and roundtrip the return URL
- var props = new AuthenticationProperties
- {
- RedirectUri = returnUrl,
- Items = { { "scheme", provider } }
- };
- return new ChallengeResult(provider, props);
- }
-
-
// GET: /Account/Register
[HttpGet]
[AllowAnonymous]
diff --git a/src/Services/Identity/Identity.API/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs b/src/Services/Identity/Identity.API/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs
deleted file mode 100644
index 5d4f597a2..000000000
--- a/src/Services/Identity/Identity.API/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.ComponentModel.DataAnnotations;
-
-namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels
-{
- public class ExternalLoginConfirmationViewModel
- {
- [Required]
- [EmailAddress]
- public string Email { get; set; }
- }
-}
diff --git a/src/Services/Identity/Identity.API/Models/ManageViewModels/ManageLoginsViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/ManageLoginsViewModel.cs
deleted file mode 100644
index 0b24c3b7c..000000000
--- a/src/Services/Identity/Identity.API/Models/ManageViewModels/ManageLoginsViewModel.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using Microsoft.AspNetCore.Http.Authentication;
-using Microsoft.AspNetCore.Identity;
-using System.Collections.Generic;
-
-namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
-{
- public class ManageLoginsViewModel
- {
- public IList CurrentLogins { get; set; }
-
- public IList OtherLogins { get; set; }
- }
-}
diff --git a/src/Services/Identity/Identity.API/Models/ManageViewModels/RemoveLoginViewModel.cs b/src/Services/Identity/Identity.API/Models/ManageViewModels/RemoveLoginViewModel.cs
deleted file mode 100644
index c9171fcf3..000000000
--- a/src/Services/Identity/Identity.API/Models/ManageViewModels/RemoveLoginViewModel.cs
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.ManageViewModels
-{
- public class RemoveLoginViewModel
- {
- public string LoginProvider { get; set; }
- public string ProviderKey { get; set; }
- }
-}
diff --git a/src/Web/WebMVC/Controllers/AccountController.cs b/src/Web/WebMVC/Controllers/AccountController.cs
index cf22de133..0f214b8ea 100644
--- a/src/Web/WebMVC/Controllers/AccountController.cs
+++ b/src/Web/WebMVC/Controllers/AccountController.cs
@@ -16,7 +16,7 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers
public async Task SignIn(string returnUrl)
{
var user = User as ClaimsPrincipal;
-
+
var token = await HttpContext.GetTokenAsync("access_token");
if (token != null)
@@ -33,11 +33,11 @@ namespace Microsoft.eShopOnContainers.WebMVC.Controllers
{
await HttpContext.SignOutAsync(CookieAuthenticationDefaults.AuthenticationScheme);
await HttpContext.SignOutAsync(OpenIdConnectDefaults.AuthenticationScheme);
-
+
// "Catalog" because UrlHelper doesn't support nameof() for controllers
// https://github.com/aspnet/Mvc/issues/5853
var homeUrl = Url.Action(nameof(CatalogController.Index), "Catalog");
- return new SignOutResult(OpenIdConnectDefaults.AuthenticationScheme,
+ return new SignOutResult(OpenIdConnectDefaults.AuthenticationScheme,
new AspNetCore.Authentication.AuthenticationProperties { RedirectUri = homeUrl });
}
}