2024-12-29 18:58:01 -06:00
|
|
|
|
using LANCommander.Server.Services;
|
|
|
|
|
|
using LANCommander.Server.Services.Models;
|
|
|
|
|
|
using Microsoft.AspNetCore.Authentication;
|
2024-10-07 18:04:26 -05:00
|
|
|
|
|
|
|
|
|
|
namespace LANCommander.Server.Extensions
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class HttpContextExtensions
|
|
|
|
|
|
{
|
2024-12-29 18:58:01 -06:00
|
|
|
|
public static IEnumerable<AuthenticationProvider> GetExternalProviders(this HttpContext context)
|
2024-10-07 18:04:26 -05:00
|
|
|
|
{
|
2024-12-29 18:58:01 -06:00
|
|
|
|
var settings = SettingService.GetSettings();
|
|
|
|
|
|
|
|
|
|
|
|
return settings.Authentication.AuthenticationProviders;
|
2024-10-07 18:04:26 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public static async Task<bool> IsProviderSupportedAsync(this HttpContext context, string provider)
|
|
|
|
|
|
{
|
2024-12-29 18:58:01 -06:00
|
|
|
|
return true;
|
2024-10-07 18:04:26 -05:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|