Показаны сообщения с ярлыком owin. Показать все сообщения
Показаны сообщения с ярлыком owin. Показать все сообщения

воскресенье, 5 апреля 2020 г.

OWIN in ASP.NET Core? ASP.NET Core vs selfhost ASP.NET

https://docs.microsoft.com/ru-ru/aspnet/core/fundamentals/owin?view=aspnetcore-3.1



Yes. In fact, all ASP.NET Core applications are self-hosted. Even in production, IIS/Nginx/Apache are a reverse proxy for the self-hosted application.
In a reasonably standard Program.cs class, you can see the self-hosting. The IISIntegration is optional - it's only necessary if you want to integrate with IIS.
public class Program
{
    public static void Main(string[] args)
    {
        var config = new ConfigurationBuilder()
            .AddCommandLine(args)
            .AddEnvironmentVariables(prefix: "ASPNETCORE_")
            .Build();

        var host = new WebHostBuilder()
            .UseConfiguration(config)
            .UseKestrel()
            .UseContentRoot(Directory.GetCurrentDirectory())
            .UseIISIntegration()
            .UseStartup<Startup>()
            .Build();

        host.Run();
    }
}

https://stackoverflow.com/questions/35997873/migrating-from-owin-to-asp-net-core

  • Middleware is quite similar between Katana and Core but you use HttpContext instead of IOwinContext.
  • Startup.cs is similar but there's much more DI support.
  • WebApi has been merged into MVC
  • DelegatingHandler is gone, use middleware instead.
  • HttpConfiguration has been split up into Routing and MvcOptions.

понедельник, 20 ноября 2017 г.

NuGet WebApi.Owin SelfHost

Selfhost


Install-Package Microsoft.Owin

Install-Package Microsoft.Owin.Cors

Install-Package Microsoft.Owin.SelfHost

Install-Package Microsoft.AspNet.SignalR

Install-Package Microsoft.AspNet.WebApi.SelfHost -Version 5.2.3

Install-Package Microsoft.AspNet.WebApi.Owin -Version 5.2.3

 Install-Package Microsoft.Owin.Host.SystemWeb

Identity:

Install-Package Microsoft.AspNet.Identity.Owin

Install-Package Microsoft.AspNet.Identity.EntityFramework





Microsoft.Owin.Hosting.Start and Stop

https://stackoverflow.com/questions/31562192/owin-stop-server-service


private IDisposable myServer;

public void Start() {
    myServer = WebApp.Start(URL);
}

public void Stop() {
    myServer.Dispose();
}

WEB API/ Security, Authentication, and Authorization in ASP.NET Web API

https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/

Important

Update-package Microsoft.Asp.Net.WebApi

http://www.c-sharpcorner.com/uploadfile/ff2f08/token-based-authentication-using-asp-net-web-api-owin-and-i/

Add User

use OWinTest

INSERT [dbo].[AspNetUsers] ([Id], [Email], [EmailConfirmed], [PasswordHash], [SecurityStamp],[PhoneNumber], [PhoneNumberConfirmed], [TwoFactorEnabled], [LockoutEndDateUtc], [LockoutEnabled], [AccessFailedCount], [UserName])  

VALUES (N'9f15bdd0fcd5423190c2e877ba0228ee', N'abc@gail.com', 1, 
N'ALkHGax/i5KBYWJ7q4jhJmMKmm2quBtnnqS8KcmLWd2kQpN6FaGVulDmmX12s7YAyQ==', 
N'a7bc5c5c-6169-4911-b935-6fc4df01d313', NULL, 0, 0, NULL, 0, 0, N'Jignesh') 

Migration: Configurate, Init
enable-migrations -ContextTypeName OwinAuthentication.Models.OwinAuthDbContext
Add-Migration -configuration OwinAuthentication.Migrations.Configuration InitialEntities
Update-Database -configuration:OwinAuthentication.Migrations.Configuration -Verbose


https://metanit.com/sharp/aspnet_webapi/5.1.php


https://stackoverflow.com/questions/15176538/net-httpclient-how-to-post-string-value

воскресенье, 8 октября 2017 г.

Web Api with Autho

https://habrahabr.ru/post/231807/

https://stackoverflow.com/questions/9571445/asp-net-web-api-self-host-with-windows-authentication

https://stackoverflow.com/questions/45485454/owin-self-host-with-windows-authentication-allowanonymous-not-working

https://www.codeproject.com/Tips/1057538/Authorization-on-Self-Hosted-SignalR-Server-with

https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/authentication-and-authorization-in-aspnet-web-api


OWIN

https://coding.abel.nu/2014/06/writing-an-owin-authentication-middleware/

https://habrahabr.ru/post/202344/

https://brockallen.com/2013/08/07/owin-authentication-middleware-architecture/

https://msdn.microsoft.com/en-us/library/dn253811(v=vs.113).aspx

https://seminda.wordpress.com/2017/01/12/building-an-owin-authentication-middleware/

https://www.scottbrady91.com/Katana/OWIN-Basic-Authentication

https://github.com/dotnet/home/blob/master/projects/owin-authentication-middleware.md

https://gist.github.com/eberlitz/9694818

https://dotnetcodr.com/2015/11/26/wiring-up-a-custom-authentication-method-with-owin-in-web-api-part-4-putting-the-components-to-work/

https://chris.59north.com/post/Understanding-OWIN-(Katana)-Authentication-Middleware

https://stackoverflow.com/questions/44524318/asp-net-web-api-2-custom-owin-auth-middleware-working-with-authorize-attribute

https://www.codeproject.com/Articles/864725/ASP-NET-Understanding-OWIN-Katana-and-the-Middlewa

https://weblogs.asp.net/cibrax/writing-an-authenticationhandler-for-katana

https://www.microsoftpressstore.com/articles/article.aspx?p=2473126

https://www.red-gate.com/simple-talk/dotnet/net-framework/creating-custom-oauth-middleware-for-mvc-5/

http://world.episerver.com/documentation/developer-guides/CMS/security/configuring-mixed-mode-owin-authentication/

http://blog.tamizhvendan.in/blog/2015/02/04/step-6-authentication-using-owin-middleware-and-asp-dot-net-identity/

http://lvasquez.github.io/2015/07/20/ASP-MVC-5-Authentication/

https://long2know.com/2016/07/asp-net-core-oauth-middleware/

Crypto

https://dotnetcodr.com/security-and-cryptography/








суббота, 5 декабря 2015 г.

SignalR SelfHost Examples

http://www.codeproject.com/Articles/892634/Using-SignalR-Broadcasting-and-Notifications-with

http://www.asp.net/signalr/overview/deployment/tutorial-signalr-self-host

https://www.nuget.org/packages/Microsoft.AspNet.SignalR.SelfHost/

http://weblog.west-wind.com/posts/2013/Sep/04/SelfHosting-SignalR-in-a-Windows-Service

https://code.msdn.microsoft.com/windowsapps/SignalR-self-hosted-in-6ff7e6c3

https://rniemand.azurewebsites.net/signalr-self-hosted/

http://www.dotnetcurry.com/windowsapp/918/windows-81-client-self-hosted-signalr-server

https://github.com/SignalR/SignalR/wiki/Self-host

http://stackoverflow.com/questions/33274527/self-host-asp-net-web-api-and-self-host-signalr-together-windows-service-applica

Web Api SelfHosting

понедельник, 3 ноября 2014 г.

owin

Install-Package Microsoft.Owin

Install-Package Microsoft.Owin.Cors

Install-Package Microsoft.Owin.SelfHost

Install-Package Microsoft.AspNet.SignalR