feat: обновил зависимости и улучшил поддержку MFA в MicrosoftLoginHelper
Create and publish a Docker image / Publish image (push) Successful in 5m27s
Create and publish a Docker image / Publish image (push) Successful in 5m27s
This commit is contained in:
1 parent
89316e247f
commit
7e27b0742b
4 files changed
+43
-5
No files matched your search
+15
@@ -0,0 +1,15 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Rider ignored files
|
||||||
|
/modules.xml
|
||||||
|
/contentModel.xml
|
||||||
|
/projectSettingsUpdater.xml
|
||||||
|
/.idea.ModeusSchedule.MSAuth.iml
|
||||||
|
# Ignored default folder with query files
|
||||||
|
/queries/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Microsoft.Extensions.Logging;
|
|
||||||
using Microsoft.Playwright;
|
using Microsoft.Playwright;
|
||||||
|
|
||||||
namespace ModeusSchedule.MSAuth.BrowserScripts;
|
namespace ModeusSchedule.MSAuth.BrowserScripts;
|
||||||
@@ -122,6 +121,30 @@ public static class MicrosoftLoginHelper
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
// Microsoft может предложить добавить еще один способ проверки после успешного MFA.
|
||||||
|
// Ссылка определяется по адресу, чтобы обработка не зависела от языка страницы.
|
||||||
|
var skipMfaRegistration = page.Locator("a[href*='skipmfaregistration=1']").First;
|
||||||
|
var canSkipMfaRegistration = false;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await skipMfaRegistration.WaitForAsync(new()
|
||||||
|
{
|
||||||
|
State = WaitForSelectorState.Visible,
|
||||||
|
Timeout = 8_000
|
||||||
|
});
|
||||||
|
canSkipMfaRegistration = true;
|
||||||
|
}
|
||||||
|
catch (TimeoutException)
|
||||||
|
{
|
||||||
|
logger.LogDebug("Предложение настроить дополнительный способ MFA не появилось — пропускаем шаг.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canSkipMfaRegistration)
|
||||||
|
{
|
||||||
|
logger.LogInformation("Откладываем настройку дополнительного способа MFA.");
|
||||||
|
await skipMfaRegistration.ClickAsync();
|
||||||
|
}
|
||||||
|
|
||||||
await page.WaitForSelectorAsync("button, input[type='submit'], a", new PageWaitForSelectorOptions { Timeout = 8000 });
|
await page.WaitForSelectorAsync("button, input[type='submit'], a", new PageWaitForSelectorOptions { Timeout = 8000 });
|
||||||
|
|
||||||
var locator = page.Locator("#idSIButton9, #idBtn_Back").First;
|
var locator = page.Locator("#idSIButton9, #idBtn_Back").First;
|
||||||
|
|||||||
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
FROM mcr.microsoft.com/dotnet/sdk:9.0-alpine3.22 AS build
|
FROM mcr.microsoft.com/dotnet/sdk:10.0-alpine3.24 AS build
|
||||||
ARG BUILD_CONFIGURATION=Release
|
ARG BUILD_CONFIGURATION=Release
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN dotnet restore "ModeusSchedule.MSAuth.csproj"
|
RUN dotnet restore "ModeusSchedule.MSAuth.csproj"
|
||||||
RUN dotnet publish "ModeusSchedule.MSAuth.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
RUN dotnet publish "ModeusSchedule.MSAuth.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||||
|
|
||||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
|
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net9.0</TargetFramework>
|
<TargetFramework>net10.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Playwright" Version="1.48.0" />
|
<PackageReference Include="Microsoft.Playwright" Version="1.63.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
Reference in new issue
Block a user