wif

Microsoft.IdentityModel vs System.IdentityModel

谁说胖子不能爱 提交于 2019-12-04 15:49:42
问题 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? 回答1: If you are using Claims Based authentication/authorization, then you will need to use Microsoft.IdentityModel as that is part of the Windows

How to track expired WIF fedauth cookies?

ぃ、小莉子 提交于 2019-12-04 14:19:06
问题 I have an interesting problem with trying to keep track of expired WIF authentication sessions/cookies. As a bit of background: the site is MVC 3, uses Windows Identity Foundation (WIF) that has a trust with an ADFS server as an STS. The entire site is protected by SSL. The STS has the token expiry set to 60 minutes. When a user signs out manually, we just simply call the SignOut method on the FedAuth module: FederatedAuthentication.WSFederationAuthenticationModule.SignOut(false); This of

ASP.NET requestValidation 4.5 and WIF

泄露秘密 提交于 2019-12-04 10:59:30
I have an ASP.NET MVC application with Windows Identity Foundation authentication enabled with ADFS as STS. The application is now on .NET 4.5 with MVC 4. When I change the ASP.NET requestValidation from 2.0 to 4.5, I get this error: A potentially dangerous Request.Form value was detected from the client (wresult="<t:RequestSecurityTo..."). I guess this is the redirect from ADFS. How can I fix this? Upgrade your application to use WIF 4.5 included in the framework: http://msdn.microsoft.com/en-us/library/jj157089.aspx Set RequestValidation to 4.5 mode: <httpRuntime targetFramework="4.5"

Wrong Thread.CurrentPrincipal in async WCF end-method

六眼飞鱼酱① 提交于 2019-12-04 10:49:10
问题 I have a WCF service which has its Thread.CurrentPrincipal set in the ServiceConfiguration.ClaimsAuthorizationManager . When I implement the service asynchronously like this: public IAsyncResult BeginMethod1(AsyncCallback callback, object state) { // Audit log call (uses Thread.CurrentPrincipal) var task = Task<int>.Factory.StartNew(this.WorkerFunction, state); return task.ContinueWith(res => callback(task)); } public string EndMethod1(IAsyncResult ar) { // Audit log result (uses Thread

Set up STS but keep formsauthentication in webapp

回眸只為那壹抹淺笑 提交于 2019-12-04 10:48:20
I'm enabling an windows identity foundation on an existing webapp. I want to mess as little as possile with the existing code so I would like to the login page which uses formsauthentication left in the application and I just connect with the STS if the user enters the application via a specific page e.g "im_comming_from_some_other_site.aspx". in the "im_comming_from_some_other_site.aspx" the code would be like: Page_Load(...) { if(verifyAgainstSTS() { FormsAuthentication.SetAuthCookie(<some_STS_Userid), ...) Response.Redirect("default.aspx") } else { Response.Redirect("http://<STS_server_name

Windows Identity Foundation does not officially support SAML 2.0; use WIF CTP or stick with SAML 1.1?

爱⌒轻易说出口 提交于 2019-12-04 09:53:23
问题 We would like to use SAML 2.0 for a Single Sign On solution. As a typical Microsoft shop, we prefer to use Microsoft components as much as possible. Windows Identity Foundation supports SAML 2.0, but the extension is still in Community Technology Preview (CTP) for more than a year, with no information anywhere on future course. See http://blogs.msdn.com/b/alikl/archive/2011/05/16/windows-identity-foundation-wif-extension-for-saml-2-0-protocol-community-technology-preview-ctp.aspx I came

Message: ID4243: Could not create a SecurityToken. A token was not found in the token cache and no cookie was found in the context

喜你入骨 提交于 2019-12-04 09:51:33
问题 We're getting the exact same error as in this thread ... in our production environment. [WIF Security Token Caching Does anybody have a fix to this error ? Message: ID4243: Could not create a SecurityToken. A token was not found in the token cache and no cookie was found in the context. Here is some info about our setup: • We‘re using built-in Windows Identity Framework with .NET Framework 4.5.1 • The problem is almost always associated with changing from RelyingParty#X over to RelyingParty#Y

Identity is not IClaimsIdentity using WIF (on ASP.NET MVC 4 / Azure)

北城以北 提交于 2019-12-04 09:23:34
I've got the WIF tools for VS2012RC, and I'm trying to get my ASP.NET MVC 4 project to use them. I've installed the NuGet package for Microsoft.IdentityModel.dll. The MVC project is part of an Azure project, but I have the MVC project selected for startup right now. Currently, I have the "Local Development Test STS" selected (with the default settings). When I execute the following code (in my HomeController Index view): <p>Authenticated: @User.Identity.IsAuthenticated</p> <p>Name: @User.Identity.Name</p> @{ var identity = User.Identity as Microsoft.IdentityModel.Claims.IClaimsIdentity; if

BootstrapContext is null on ClaimsIdentity

拟墨画扇 提交于 2019-12-04 03:41:39
I have created a new ASP.NET MVC application with .NET 4.5. I have successfully set up authentication with an STS. The authentication flow is working fine and I am able to get the ClaimsIdentity, containing the desired claims, on Thread.CurrentPrincipal. Now I need the bootstrap token to secure the calls to my service layer. I have set the saveBootstrapContext to true on the identityConfiguration element. <system.identityModel> <identityConfiguration saveBootstrapContext="true"> However, the BootstrapContext property on the ClaimsIdentity is always null. var identity = Thread.CurrentPrincipal

WIF config: issuerNameRegistry vs. certificateValidation

巧了我就是萌 提交于 2019-12-03 22:38:56
问题 In the Windows Identity Foundation (WIF) 4.5 config, what is the relationship between issuerNameRegistry and certificateValidation ? What portion of a SAML 2.0 assertion is validated by each? For example: the code & config below will verify that the issuer cert has the given thumbprint. But I assume a certificateValidationMode other than "None" will validate some additional details? var handlers = FederatedAuthentication.FederationConfiguration.IdentityConfiguration.SecurityTokenHandlers; var