Security icon indicating copy to clipboard operation
Security copied to clipboard

Port OAuth Authorization Server from Katana

Open tugberkugurlu opened this issue 12 years ago • 20 comments

I saw the discussion about this on #39. @Tratcher suggested to open up a new issue for this and here it is :smile:

I personally want to see OAuthAuthorizationServerMiddleware ported here because of my selfish reasons :smile: as I used this inside a project which we consider porting over to vNext. I also see questions, feedback, etc. for OAuthAuthorizationServerMiddleware which indicates that it's being used.

However, I agree with @leastprivilege here. It should live inside its own world.

tugberkugurlu avatar Oct 26 '14 12:10 tugberkugurlu

For reference, here's my opinion regarding this port: https://github.com/aspnet/Security/issues/39#issuecomment-53137076 :+1:

@tugberkugurlu FYI, I just ported OpenIdConnectServerMiddleware - a fork of the Katana OAuth2 authorization server - to vNext: https://github.com/AspNet-OpenIdConnect-Server/Owin.Security.OpenIdConnect.Server/tree/vNext.

You can't target aspnetcore50 (mainly because the JWT stuff has not been ported yet: https://github.com/aspnet/Security/issues/40), but aspnet50 is fully supported and I've updated the MVC sample to use MVC 6. If you give it a try, please don't hesitate to share your feedback :smile_cat:

Edit: you can now find it on MyGet: https://www.myget.org/F/aspnet-openidconnect-server/

kevinchalet avatar Oct 26 '14 21:10 kevinchalet

Here's some feedback that came up in an offline discussion with @leastprivilege:

  • One trouble with the existing implementation is that it tries to expose the entire OAuth spec. Only a few flows were easy to use and the others cause you to very quickly get lost.
  • Consider breaking the server down into separate middleware that implement very specific flows. This way a developer only sees and configures the parts they care about.

Tratcher avatar Nov 04 '14 23:11 Tratcher

In my humble opinion, the low-level (and complete) approach offered by the OAuth2 server built in Katana is probably its greatest feature... you can do virtually anything in a few lines of code :smile: I personally feel far more comfortable with the unique IOAuthAuthorizationServerProvider interface than with the dozens of interfaces used by IdSrv.

Honestly, having 4 flows supported OTB (via GrantAuthorizationCode, GrantRefreshToken, GrantResourceOwnerCredentials and GrantClientCredentials) and 1 hook for custom flows (via GrantCustomExtension) is not what I'd call infernal :smile:

I have the firm conviction that you shouldn't try to compete with IdSrv, they just don't serve the same purposes and the same targets.

kevinchalet avatar Nov 05 '14 00:11 kevinchalet

FYI, @Tratcher said yesterday on #aspnetvnext that they were not "planning on [porting OAuthAuthorizationServerMiddleware]" and that they preferred "referring people to Thinktecture".

Not surprising but a bit sad :sob:

kevinchalet avatar Nov 15 '14 17:11 kevinchalet

We still need to do the due diligence to demonstrate that Thinktecture adequately fulfills the needed scenarios.

Tratcher avatar Nov 15 '14 18:11 Tratcher

It's very community driven to see about everyone preferring OAuthAuthorizationServerMiddleware but just ignoring it ;)

Let's see how many versions it takes until vNext is useable again apart from samples.

Suchiman avatar Dec 07 '14 19:12 Suchiman

@Tratcher IMHO IdentityServer v3 fills all the nedded scenarios plus more. You can opt out of an advanced configuration if one is not deeded. BUT there is no indication that the project has even started to port to a aspnet core compatible version. That said we need something to work with until this happens.

cleftheris avatar May 13 '15 11:05 cleftheris

@cleftheris you should give AspNet.Security.OpenIdConnect.Server (https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server) a try, it now fully supports dnxcore50 :smile:

kevinchalet avatar May 13 '15 11:05 kevinchalet

@PinpointTownes I am already on this track. Having a bit of a trouble managing all the dependency chaos of beta5* (Abstractions/interfaces stuff) plus the shortcomings of the EF7 current status. But will eventually make it work.

cleftheris avatar May 13 '15 12:05 cleftheris

No we haven't started porting to CoreClr - don't see the need for that right now. It runs fine in ASP.NET 5 DNX451 and Mono.

On related news - IdentityServer3 is as of today a fully certified OpenID Connect implementation. So it depends on where your priorities are.

http://openid.net/certification/

leastprivilege avatar May 13 '15 13:05 leastprivilege

DNX451 will not work on the Microsoft Nano Server or within a docker container or even run on a mac/linux box so i can see a very strong reason to port the application

On Wed, May 13, 2015 at 2:16 PM, Dominick Baier [email protected] wrote:

No we haven't started porting to CoreClr - don't see the need for that right now. It runs fine in ASP.NET 5 DNX451 and Mono.

On related news - IdentityServer3 is as of today a fully certified OpenID Connect implementation. So it depends on where your priorities are.

http://openid.net/certification/

— Reply to this email directly or view it on GitHub https://github.com/aspnet/Security/issues/83#issuecomment-101660084.

alikor avatar May 13 '15 13:05 alikor

It runs fine on Mac/Linux using Mono.

But yeah - we will port at some point. That's not the question.

leastprivilege avatar May 13 '15 13:05 leastprivilege

Hi guys,

How to login to ASP.NET 5 Web Api by WebClient class in a .NetFramework 2 Windows Forms? I have already done that for ASP.NET 4.5 using this article http://www.asp.net/web-api/overview/security/individual-accounts-in-web-api But don't know how to do it for ASP.NET 5. It seems Authorization Server is not supported by it. Is there any alternative? In a nut shell, what is your solution to secure an ASP.NET 5 Web Api that is used by third party clients such as mobile or windows application?

Please help

eqbalsajadi avatar Jul 14 '15 19:07 eqbalsajadi

For anyone still looking for the original OAuth Authorization Server in ASP.NET 5, I have ported the code and the original sample here: https://github.com/XacronDevelopment/oauth-aspnet

The port includes backwards compatibility to allow ASP.NET 4.x resource servers to read the access tokens created by the authorization server.

The nuget packages are here: https://www.nuget.org/packages/OAuth.AspNet.AuthServer https://www.nuget.org/packages/OAuth.AspNet.Tokens https://www.nuget.org/packages/OAuth.Owin.Tokens

Xacron avatar Sep 21 '15 13:09 Xacron

Thank you. On Sep 21, 2015 5:54 PM, "Xacron" [email protected] wrote:

For anyone still looking for the original OAuth Authorization Server in ASP.NET 5, I have ported the code and the original sample here: https://github.com/XacronDevelopment/oauth-aspnet

The port includes backwards compatibility to allow ASP.NET 4.x resource servers to read the access tokens created by the authorization server.

The nuget packages are here: https://www.nuget.org/packages/OAuth.AspNet.AuthServer https://www.nuget.org/packages/OAuth.AspNet.Tokens https://www.nuget.org/packages/OAuth.Owin.Tokens

— Reply to this email directly or view it on GitHub https://github.com/aspnet/Security/issues/83#issuecomment-141974799.

eqbalsajadi avatar Sep 21 '15 16:09 eqbalsajadi

I'm updating the source and packages now to remove explicit references to Microsoft.Framework.NotNullAttribute.Sources(Internal)

Xacron avatar Sep 21 '15 16:09 Xacron

Since this issue gets referenced every time somebody asks about token issuance in ASP.NET 5 - here's a small walkthrough how to do it with identityserver:

http://leastprivilege.com/2015/07/22/the-state-of-security-in-asp-net-5-and-mvc-6-oauth-2-0-openid-connect-and-identityserver/

leastprivilege avatar Dec 23 '15 20:12 leastprivilege

Closing because there are no plans to do this specific feature.

Eilon avatar May 11 '17 22:05 Eilon

@Eilon it's worth noting that community projects are now listed here: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/community (people looking for the same low level experience as with the OAuth2 authorization server middleware shipped with Katana should probably try ASOS).

kevinchalet avatar May 11 '17 23:05 kevinchalet

Ah, of course! I added a link to that doc from the readme as well: https://github.com/aspnet/Security/blob/dev/README.md

Eilon avatar May 11 '17 23:05 Eilon