I have an existing asp.net mvc application (Pivotal) with its own authentication mechanism. I want to use this as a Security Token Service for Windows Identity Foundation so that other related web applications can use Pivotal for authentication.
The WIF docs claim that a web app can be used as a STS, but provide no examples. I can't find anything online that relates to the current versions .net/WIF. I am using VS 2017, .net 4.52, c# and MVC 5. The examples that I have found related to VS2012 and don't work in VS2017.
Are there any guides or examples that can help?
Totally agree with "don't roll your own" but if you want to, refer this.
Then convert 3.5 to 4.5.
Related
I'm trying to use the strangler fig pattern to migrate a legacy Net Framework MVC app in stages. I heard a talk by Mark Rendle about using YARP to migrate a Webforms app this way, which was great. However, I can't find any examples anywhere of using this methodology to migrate from a Net Framework MVC app to new Net 6 MVC app.
I've managed to set up the basic proxy which is working (see example repo below). However I don't know where to begin with flowing the Identity Authentication through from the Net 6 App to the Net Framework app. I can see that the auth cookie is passed through to the proxied Net Framework app, but I don't know how to take that and say "hey use this" in the Framework app.
Links:
Example Repo
Microsoft YARP Proxy
Strangler fig Pattern (Microsoft Doc)
Any pointers on how to achieve this authentication flow would be greatly appreciated.
Microsoft must have been getting this a lot...
They have created a new nuget package (currently in preview):
Microsoft.AspNetCore.SystemWebAdapters
And have an article on its use (thanks Mike Rousos!):
https://devblogs.microsoft.com/dotnet/incremental-asp-net-migration-tooling-preview-2/
I have updated my example git repo and reworked a few bits and everything seems to be working as expected.
Happy days.
I'm a rookie with just a few months of training in programming, so please don't be harsh on me.
Right now I'm working on a simple MVC web app using ASP.NET Core 2.2. My problem is that I have to implement login, with users, that are already provided in a external database.
I have read a number of articles and forums and I can't quite find what I'm looking for. Most of the articles are about extending the built-in authentication of ASP.NET Core which I can't use. The ones that implement fully custom login from external database are written based on older versions of ASP.NET Framework - so I have troubles understanding it, being a newbie at this.
I will be grateful for any kind of directions, suggestions, step by step tutorials etc.
Thank you in advance!
You must need you googled but first i found some post for this problem like this,
this post about CRUD operations with sql server 2017 - Basic CRUD
possible you know this web site here for understand .net core or folder structure .net Core Tutorial
I absolutely recommend this man for every topic about .net core/ .net this post basic Simple API for Authentication
Authentication and Authorization
last 2 post for basic login
https://www.c-sharpcorner.com/article/asp-net-core-razor-pages-simple-login-using-entity-framework-database-first-app/
http://future-shock.net/blog/post/creating-a-simple-login-in-asp.net-core-2-using-authentication-and-authorization-not-identity
I have a ASP.NET Core MVC application that register/login users using ASP.NET Identity by providing a registration/login form or using Google OAuth. Now we want to build a mobile application to use our API server (build with ASP.NET Core Web API hosted in a sub-domain of the website) but we want to have the same register/login flow in that too.
I dig around and find out that IdentityServer4 has the necessary features to support our needs and read its documentation but unfortunately I couldn't make it to work as I wanted to.
The scenario is that we have a Web Application, Web API and a Mobile application which all of them should use same register login flow which is to register and login in the application or use Google OAuth.
I appreciate if anyone can point me to a good documentation or sample code for both MVC client application and Identity Server (for authentication) with the same requirements.
If you take a look at the quickstart samples, it will give you a good place to start. That sample has MVC client using implicit flow for authentication against the identity provider. You can easily extend the controllers (like this one for example) with routes and code to do registration logic. This sample does external login using google for your convenience. For mobile you would probably want to use Hybrid grant/flow and depending on your platform/device google can help you find libraries to do this.
HTH
I want to Integrate Single Sign on through SAML into my web application which is using Forms Authentication and membership. I really dont have an Idea on how to achieve this. any links or tutorials will be helpful. I would like to know where to start exactly and the various things i need to do to achieve this
Thanks
To work with SAML in .NET, you should use standard components. There are several commercial and open source options available.
I'm working on the Kentor AuthServices open source library. Using that library, you could migrate by:
Upgrade your application to use OWIN-based cookie-authentication and ASP.NET Identity instead of membership. This will increase security in general.
Configure the Kentor AuthServices SAML2 Owin middleware to be used as an external authentication provider with ASP.NET Identity.
To get started, it's probably easiest to create a new empty ASP.NET application where all code is generated for you. Then you can copy that code.
You can use Componet Pro SAML
Componet Pro SAML can be used from ASP.NET web pages, Windows Forms and Web Services and runs under .NET Framework 2.x and above.
Componet Pro SAML supports Single Sign (SSO) scenario
I'm starting an ASP.NET MVC 5 project in VS 2013, which will eventually need to support CAS (Central Authentication Service) for authentication. Jasig has an official .NET client, but it's somewhat old and seems to have been created in the MVC 3 days.
Does anyone have experience marrying this technology with the newer MVC 4 or 5? Of special concern to me is that MVC 5 now uses OWIN authentication in place of the old Forms Authentication, which is how CAS ties into ASP.
I want to get this project started on the right foot so that, when the time comes later to add CAS, I'm not scrambling to re-create major parts of the code. I would prefer to do this in MVC 5 with VS 2013, but MVC 4 in VS 2012 is also an option.
e: I realize I haven't really "asked a question" as SO prefers. It comes down to this: Can I use CAS with MVC 5, what limitations will I run into, and what special workarounds (if any) are necessary to integrate it into my project?
The current version of the CAS client will still work in MVC 5, but unforunately you can't leverage anything that depends on claims-based authentication. This means that some of the packages that install when you use File-New Project would need to be removed and you'd need to revert back to the legacy Forms Authentication Module approach. Also, since .NET 4.0, the FormsAuthenticationModule was
There are 2 problems that I see with the current version of the CAS client with respect to OWIN
The client is using a custom IPrincipal class called CasPrincipal. It looks like it should be modified to leverage the ClaimsPrincipal. This work is non-trivial and would break compatibility with .NET 2.0/3.5. It would address a long-standing issue regarding how to handle roles/group membership information that can be provided by the CAS server.
The longer-term issue is that having a dependency on System.Web is going to be a problem as OWIN begins to play a bigger picture in ASP.NET. I haven't looked closely enough at how to approach this, but it would likely have to be a separate client package. Breaking 2.0/3.5 compatibility is one thing, but breaking compatibility with all of the non-OWIN-aware applications out there is another.
I'm hoping to set aside some time in the coming weeks to getting the client to leverage ClaimsPrincipal and see where we can go from there.