Exemplo n.º 1
0
        public async Task<string> StartAuthServerAsync(
            [Service] IAuthWebServer authWebServer,
            StartAuthServerInput input,
            CancellationToken cancellationToken)
        {
            RunningWebServerInfo? server = await authWebServer.StartAsync(
                new StartWebServerOptions(Guid.NewGuid(), input.Port.GetValueOrDefault(3010)),
                cancellationToken);

            return server.Id.ToString();
        }
        public async Task <RunningWebServerInfo> StartAuthorizeRequestAsync(
            AuthorizeRequestData request,
            CancellationToken cancellationToken)
        {
            var id = Guid.NewGuid();

            RunningWebServerInfo server = await _authWebServer.StartAsync(
                new StartWebServerOptions(
                    Guid.NewGuid(), request.Port)
            {
                Title       = $"{request.Authority} ({request.ClienId})",
                SetupAction = (services) =>
                {
                    services.AddSingleton(request);
                    services.AddSingleton <IBoostCommandContext>(_commandContext);
                }
            }, cancellationToken);

            return(server);
        }