preparing to feed abstract

test should run ok [modulo config]
This commit is contained in:
2018-07-15 06:47:41 +02:00
parent 3505d5aa6c
commit 5f26e97f0a
36 changed files with 766 additions and 244 deletions

View File

@ -3,17 +3,24 @@ using System.Linq;
using System.Collections.Generic;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Http.Authentication;
using Yavsc.ViewModels.Account;
namespace Yavsc.Helpers {
public static class HttpContextExtensions {
public static IEnumerable<AuthenticationDescription> GetExternalProviders(this HttpContext context) {
public static IEnumerable<YaAuthenticationDescription> GetExternalProviders(this HttpContext context) {
if (context == null) {
throw new ArgumentNullException(nameof(context));
}
return from description in context.Authentication.GetAuthenticationSchemes()
where !string.IsNullOrEmpty(description.DisplayName)
select description;
select
( new YaAuthenticationDescription
{
DisplayName = description.DisplayName,
AuthenticationScheme = description.AuthenticationScheme,
Items = description.Items
});;
}
public static bool IsProviderSupported(this HttpContext context, string provider) {