Repository navigation
Expand file tree
/
Copy pathExternalAuthenticationController.cs
More file actions
66 lines (51 loc) · 1.92 KB
/
Copy pathExternalAuthenticationController.cs
File metadata and controls
66 lines (51 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using System.Collections.Generic;
using System.Web.Mvc;
using System.Web.Routing;
using SmartStore.Services.Authentication.External;
using SmartStore.Web.Models.Customer;
using SmartStore.Web.Framework.Controllers;
using SmartStore.Core;
namespace SmartStore.Web.Controllers
{
public partial class ExternalAuthenticationController : PublicControllerBase
{
#region Fields
private readonly IOpenAuthenticationService _openAuthenticationService;
private readonly IStoreContext _storeContext;
#endregion
#region Constructors
public ExternalAuthenticationController(IOpenAuthenticationService openAuthenticationService,
IStoreContext storeContext)
{
this._openAuthenticationService = openAuthenticationService;
this._storeContext = storeContext;
}
#endregion
#region Methods
public ActionResult RemoveParameterAssociation(string returnUrl)
{
ExternalAuthorizerHelper.RemoveParameters();
return RedirectToReferrer(returnUrl);
}
[ChildActionOnly]
public ActionResult ExternalMethods()
{
//model
var model = new List<ExternalAuthenticationMethodModel>();
foreach (var eam in _openAuthenticationService.LoadActiveExternalAuthenticationMethods(_storeContext.CurrentStore.Id))
{
var eamModel = new ExternalAuthenticationMethodModel();
string actionName;
string controllerName;
RouteValueDictionary routeValues;
eam.Value.GetPublicInfoRoute(out actionName, out controllerName, out routeValues);
eamModel.ActionName = actionName;
eamModel.ControllerName = controllerName;
eamModel.RouteValues = routeValues;
model.Add(eamModel);
}
return PartialView(model);
}
#endregion
}
}