24

I'm working on a claims-based authorization system using Forms Authentication and ASP.NET MVC 2. I see that one namespace "Microsoft.IdentityModel" provides a lot of the same things as the other "System.IdentityModel".

System.IdentityModel

Microsoft.IdentityModel

Why do these 2 namespaces exist seperately, when the functionality appears to overlap?

dreadwail
  • 15,098
  • 21
  • 65
  • 96
  • Not to thread jack but I got burned hard by using WIF, absolutely set it up in an ACTIVE STS configuration. WIF is not capable of functioning reliably in a passive ONLY configuration. – Chris Marisic Jan 21 '11 at 19:17

2 Answers2

55

Microsoft.IdentityModel is used by WIF in .NET 4.0 and version before. System.IdentityModel is to be used in .NET 4.5 and beyond. More details here http://msdn.microsoft.com/en-us/library/jj157091.aspx

Kalyan Krishna
  • 1,616
  • 15
  • 19
  • 1
    It's 2023 now, and `Microsoft.IdentityModel` still lives on as [`Microsoft.IdentityModel.Abstractions`](https://www.nuget.org/packages/Microsoft.IdentityModel.Abstractions), [`Microsoft.IdentityModel.JsonWebTokens`](https://www.nuget.org/packages/Microsoft.IdentityModel.JsonWebTokens), and a few others - while [`System.IdentityModel.Tokens.Jwt`](https://www.nuget.org/packages/System.IdentityModel.Tokens.Jwt) is also still active - oh, and now there's [`IdentityModel`](https://www.nuget.org/packages/IdentityModel) too. This is confusing :S – Dai Apr 24 '23 at 22:09
  • IdentityModel is a private repository not associated with MS- https://github.com/IdentityModel. Libraries usually hang around for backwards compatibility, but you should use the newest version you can as they usually work better and give you some newer options. – Westley Aug 12 '23 at 01:01
-5

If you are using Claims Based authentication/authorization, then you will need to use Microsoft.IdentityModel as that is part of the Windows Identity Framework.

For guidance around MVC2 and using WIF I would recommend checking out the work that Patterns and Practices did. They have a decent MVC sample that I used as a starting point.

Aaron Weiker
  • 2,523
  • 2
  • 21
  • 22