Подключение Electron к Identity

У меня есть приложение на Electron, которое имеет следующую конфигурацию:

AuthModule.forRoot({
  config: {
    authority: 'https://localhost:7051',
    redirectUrl: window.location.origin,
    postLogoutRedirectUri: 'https://localhost:7051/Auth/login',
    clientId: 'webApi',
    scope: 'openid WebApi',
    responseType: 'code',
    logLevel: LogLevel.Debug,
  },
}),

Также, апи имеет такой конфиг:

new Client()
{
    ClientId = "webApi",
    ClientName = "WebApi",
    AllowedGrantTypes = GrantTypes.Code,
    RequireClientSecret = false,
    RequirePkce = true,
    RedirectUris =
    {
        "http://localhost:4200"
    },
    AllowedCorsOrigins =
    {
        "http://localhost:4200"
    },
    PostLogoutRedirectUris = {
        "https://localhost:7051/Auth/login"
    },
    AllowedScopes = {
        IdentityServerConstants.StandardScopes.OpenId,
        IdentityServerConstants.StandardScopes.Profile,
        "OdinWebApi"
    },
    AllowAccessTokensViaBrowser = true,
    AllowOfflineAccess = true,
}

Если я собираю приложение на ноде, то хост http://localhost:4200 и всё работает нормально. В случае же с электроном, хост - file://. Если добавить его в RedirectUris, то получаю ошибку "invalid redirect_uri"


Ответы (0 шт):