Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET Core / OWIN Support? #67

Open
srkirkland opened this issue Sep 5, 2017 · 34 comments
Open

.NET Core / OWIN Support? #67

srkirkland opened this issue Sep 5, 2017 · 34 comments
Assignees

Comments

@srkirkland
Copy link

ASP.NET Core has a very different authentication format which is built on the Microsoft.AspnetCore.Authentication namespace (you can see their code here: https://github.com/aspnet/Security). They already provide many pre-built authentication providers, including OAuth, OIDC, JWT, Facebook, Google, etc, and other people have written extensions to bring in even more providers. As far as I can tell there are no working CAS providers for .NET Core 2.0 (the current version), and I'm wondering if this project has considered building against this new set of APIs and publishing a .NET Standard library so it can be used in .NET Standard & Core apps.

The end result would look something like this

services.AddAuthentication().AddCas(casOptions => { ... });

Thanks for your consideration!

@phantomtypist
Copy link
Contributor

Hi Scott!

The short answer is yes, I plan on adding .NET Core support. Some of the recent updates I made with regards to multi-platform/framework support laid the groundwork for adding .NET Core support (TLDR: one solution and code base to rule them all..kinda.)

Time-wise I'm probably not going to get it it until November/December because the semester just started at Stony Brook. I'm sure you know what I'm talking about with you working at UC Davis ;)

I have to circle back with @scottt732 to see what he was planning on for version 2 of this project.

@phantomtypist
Copy link
Contributor

phantomtypist commented Sep 6, 2017

@srkirkland

What are your thoughts on only supporting .NET Core 2.x?

It looks like .NET Core 1.1.2 has the LTS (Long Term Support) moniker. I guess we'd have to see how feasible it is to do both.

@phantomtypist
Copy link
Contributor

phantomtypist commented Sep 6, 2017

Based on the .NET Standard documentation it looks like we'd be supporting both .NET Standard version 1.4 (or 1.5) and 2.0.

@srkirkland
Copy link
Author

@phantomtypist ok thanks, I'd be happy to help if I can once the hard part of getting .Net Standard compatibility is done.

@phantomtypist
Copy link
Contributor

@srkirkland much appreciated.

@phantomtypist
Copy link
Contributor

@srkirkland getting close to being ready to work on this!!!!!

I want to wrap up a few other items with @TheHokieCoder before we add .NET Core support.

@mccalltd
Copy link

mccalltd commented Feb 9, 2018

Is there anything new to report on this? I'm interested in .NET Core support as well.

@phantomtypist
Copy link
Contributor

@mccalltd I just mentioned this on the Gitter channel :)

TL;DR, yes, we are going to make a .NET Core, most likely only 2.x though. Do you need a .NET Core 1.x implementation or is 2.x work for your situation?

I didn't dig deep enough, but we may be able to do both using .NET Standard 1.4/1.5.

I'm going to touch base with @srkirkland and discuss with him.

@mccalltd feel free to leave us comments and feedback on your project(s) that will be using the .NET Core implementation.

@mccalltd
Copy link

mccalltd commented Feb 9, 2018

2.x works for me! Thanks for the feedback.

@mspasiuk
Copy link

mspasiuk commented Feb 9, 2018

2.x works for me too. Thanks!

@brinehart
Copy link

2.x works for me too. Has there been any progress on this? I haven't seen any PRs

@phantomtypist
Copy link
Contributor

No, no progress :( Work and life has been a bit hectic lately.

@srkirkland I pinged you at your UC Davis email.

@phantomtypist
Copy link
Contributor

phantomtypist commented Apr 20, 2018

At a higher level, the .NET CAS Client project needs to cover the following scenarios:

ASP.NET Identity (OWIN middleware)

  • MVC 6 / ASP.NET Core
    • .NET Framework 4.6
    • .NET Core 1.x/2.x

ASP.NET Identity (OWIN middleware) or Membership

  • MVC 5 / ASP.NET 4.5 Web Forms / Web API 2
    • .NET Framework 4.5

ASP.NET Membership

  • MVC 4 / Web API 1
    • .NET Framework 4.0/4.5
  • MVC 3 / Web API 1
    • .NET Framework 4.0
  • MVC 2
    • .NET Framework 3.5/4.0
  • MVC 1
    • .NET Framework 3.5
  • ASP.NET 4.0 Web Forms
    • .NET Framework 4.0
  • ASP.NET 3.5 Web Forms
    • .NET Framework 3.5
  • ASP.NET 2.0 Web Forms
    • .NET Framework 2.0
  • ASP.NET 1.1 Web Forms (we don't support this version)
    • .NET Framework 1.1

Potential plan 1

Continue to only have a single NuGet package. We can use a PowerShell install script in the NuGet package to perform some assembly detection against the project the NuGet pakage is getting installed inside of. Based on that and the scenarios above I think we can install the correct .NET CAS Client assemblies in the target project.

Potential plan 2

We just stick with ASP.NET Membership in the current DotNetCasClient NuGet package. For OWIN support we make a second NuGet package called DotNetCasClient.OWIN.

Thoughts

Plan 2 is probably going to be easier to implement. Either way I'm envisioning a total of three projects in the repo.

  • The current project can remain for ASP.NET Membership support,
  • a second project for OWIN support and
  • a third project for all code that can be shared between the above two projects.

Resulting NuGet Packages

  • DotNetCasClient - Contains assemblies targeting .NET Framework 2, 3.5 and 4.x
  • DotNetCasClient.OWIN - Contains assemblies targeting .NET Standard 1.2 (because that's the lowest .NET Standard version that supports .NET Framework 4.5

@phantomtypist
Copy link
Contributor

At least we don't need to worry about supporting Web Forms on ASP.NET Core (ref dotnet/aspnetcore#1961 (comment))

@srkirkland
Copy link
Author

@phantomtypist I think plan 2 is the best option, and it seems to follow a lot of the community packages which have split off specific .OWIN and .AspNetCore versions of their packages.

The package names you proposed seem like a good idea to me too

@phantomtypist phantomtypist changed the title .NET Core Support? .NET Core / OWIN Support? May 10, 2018
@MetSystem
Copy link

2.x works for me too. Thanks!

@JLewinski
Copy link

I don't know if anyone else has made a fork to add core support, but I've got a somewhat working version. I haven't tested much of its functionality, but it works for my specific Cas20 instance.

@MikelThief
Copy link

@JLewinski could you provide some usage tips? Your repo looks like it is not different than source one.

@JLewinski
Copy link

@MikelThief it is the DotnetCore branch

@MikelThief
Copy link

@JLewinski thank you

@taadis
Copy link

taadis commented Jan 22, 2019

now, is there any progress for dotnetcore-cas-client?

@garster
Copy link

garster commented Apr 17, 2019

My co-worker wrote a CAS client from scratch for ASP.NET Core 1.0 and it has been upgraded and used in a ASP.NET Core 2.2 project. It is used all day long and fits perfectly into the ASP.NET Identity system. We are looking at open-sourcing the code and should be able to share it with you all soon.

@phantomtypist
Copy link
Contributor

@garster ok that would be nice to see. I am curious as to whether or not you tried to just add .NET Core support to this existing project and were unsuccessful? Would you be able to share what drove your team to write it from scratch?

@phantomtypist
Copy link
Contributor

phantomtypist commented Apr 17, 2019

@garster FWIW, not sure if you have seen these other couple of implementations:

GitHub
ASP.NET Core authentication provider for CAS. Contribute to IUCrimson/AspNet.Security.CAS development by creating an account on GitHub.
GitHub
Apereo .NET CAS Client With .NET CORE. Contribute to JLewinski/dotnet-cas-client-with-core development by creating an account on GitHub.

@garster
Copy link

garster commented Apr 17, 2019

@phantomtypist We started coding the client in Jan 2017, back then all I saw was a Forms Authentication module from Apereo and that would only work with ASP.NET WebForms. We were starting on a ASP.NET Core 1.0 RC app and needed a module that works like the Google, Facebook, Twitter OWIN type modules so we could just plug it into the out-of-the-box Microsoft auth system.

Either we could not find those other projects or they did not fit our needs at the time. Since those others exist I see no reason to release our code as it seems they do the same thing. Our hope is to someday use an official Apereo supported client in our .NET Core apps.

@phantomtypist
Copy link
Contributor

@garster your team can still share if they want, privately to us or publicly via PR. I'll leave it up to you. At the least if you want you could share any pain-points or gotchas you encountered. I'm sure there were lessons learned.

OWIN and .NET Core support is up next after we clean up a few more of the outstanding bugs/issues (not all of them, just a few of the pressing ones.)

@MattHodgman
Copy link

Does the current version of DotNetCasClient work with ASP.NET Core 2.1/3.1? when I install the NuGet package it says

Package 'DotNetCasClient 1.3.2' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8' instead of the project target framework '.NETCoreApp,Version=v3.1'. This package may not be fully compatible with your project.

@TheHokieCoder
Copy link
Contributor

@MattHodgman No, currently this project only targets .NET Framework. It is on our list of new features to support .NET Core, but unfortunately me and @phantomtypist have been too busy to get this completed. For the time being I recommend that you search for other CAS clients if you need it for a project targeting .NET Core. One that I have personally used is IUCrimson/AspNet.Security.CAS, but it is not feature-complete and support for it has seemingly died off. It may work for your purposes, though.

Sorry for the bad news!

@MattHodgman
Copy link

Ok, thanks for the quick reply. It will be awesome when that gets done because it seems like .NET Core is the way everything is going. I saw there is a fork where someone made a Core compatible version of DotNetCasClient... do you know what that's about?

@phantomtypist
Copy link
Contributor

@MattHodgman got a link to that forked repo? Sometimes I gotta SMH why people that do this don't just talk with us and make the contributions in the core project.

@TheHokieCoder
Copy link
Contributor

@phantomtypist I think he's probably referring to the fork by JLewinski that is mentioned a few times in previous comments. If not, I'd too be curious of what this other fork is.

I'd really like to be able to spend some time with you (via Zoom, perhaps) to go over the structure of the entire project, what targets we should have, how we should deploy those targets to separate packages (if necessary), etc. You are far more experienced with GitHub and .NET multi-targeting than I am, and that has been a major hurdle for me in getting some new features developed for this client. So I'd like to make sure that I'm making changes at the project/deployment level that are correct, leaving the easy part of the actual coding. Would you be interested in/available for that sometime in the near future?

@yoshiask
Copy link

I'm also looking for a .NET Standard library (<=2.0) for CAS, and haven't found anything. I need to use this in a native app, not an ASP.NET server, and there don't seem to be any existing libraries for this.

@ajc-uconn
Copy link

Any update on if there is still a plan to add support for .NET 6 or .NET standard to this library @phantomtypist ?

@MattHodgman
Copy link

Sorry to reply... 2 years later haha but thanks @phantomtypist I used IUCrimson/AspNet.Security.CAS and got it working on .NET Core 3.1... I haven't made the switch to Core 5.0 yet though so hopefully it still works whenever I do that. And yes @TheHokieCoder I was referring to JLewinski's, though I didn't end up using his.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests