ws-federation

UseWsFederationAuthentication - AuthenticationException: The remote certificate is invalid according to the validation procedure

给你一囗甜甜゛ 提交于 2019-12-06 10:45:18
I am getting an error every time I try to run my MVC project on my development box through VS2015 and IIS Express. It uses this code to authenticate against our ADFS server. app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); app.UseCookieAuthentication(new CookieAuthenticationOptions()); app.UseWsFederationAuthentication( new WsFederationAuthenticationOptions { Wtrealm = realm, MetadataAddress = adfsMetadata }); This is the error I am getting in the browser. [AuthenticationException: The remote certificate is invalid according to the validation procedure

How to avoid 'SamlAssertion.NotOnOrAfter condition is not satisfied' errors

Deadly 提交于 2019-12-06 10:38:40
Recently I have started using claim-based authentication on an existing web application. Because the application makes use of jQuery & more notably, the AJAX functions, I have had to alter the handlers not to attempt to redirect the XmlHTTPRequests , and instead return a 403 status which is easier to handle. Here is the FederatedAuthentication.WSFederationAuthenticationModule.AuthorizationFailed event hanlder: protected void WSFederationAuthenticationModule_AuthorizationFailed(object sender, AuthorizationFailedEventArgs e) { //WSFederationAuthenticationModule sam =

Owin WS-Federation setting up token sliding expiration

笑着哭i 提交于 2019-12-06 04:20:04
问题 Can somebody explain how to implement sliding expiration using the new Owin WS-Federation plugin? On the client side, at WS-Fedeartion configuration I see that there are some events like : Notifications = new WsFederationAuthenticationNotifications { SecurityTokenReceived = ..., AuthenticationFailed = ..., RedirectToIdentityProvider = ..., MessageReceived = ..., SecurityTokenValidated = .... }, But because the lack of documentation I can't really figure it out where an how? At the moment my

Add Owin Pipeline Middleware after OwinStartup for new Tenant

随声附和 提交于 2019-12-06 03:30:47
问题 I have a multi-tenant application where each tenant can define their own ClientID, Authority, etc for either WsFed or OpenIdConnect. All the tenants are registered in the OwinStartup as below: public void Configuration(IAppBuilder app) { List<WsFederationAuthenticationOptions> WsFedTenantOptions = BuildWsFedTenantOptionsList(); List<OpenIdConnectAuthenticationOptions> OpenIdConnectTenantOptions = BuildOpenIdConnectTenantOptionsList(); app.SetDefaultSignInAsAuthenticationType

SSO with AD FS and OWIN how to create an account and handle permissions

╄→гoц情女王★ 提交于 2019-12-05 00:54:29
问题 I configure a Web App that use AD FS, for this I use OWIN. For the login, all is ok. If i'm an user of a domain and go to the website, he is automatically connected. But what I want to have is to handle users and roles by myself after login. So I want to check that an user exists in my database with this AD account (this process will be make before the login in another application) I want to use Identity from Microsoft to handle claims (roles and permissions). But I don't understand how to

Ws-Federation authentication with ASP.NET Core

放肆的年华 提交于 2019-12-04 13:36:01
问题 I am migrating an ASP.NET application to be on ASP.NET Core, but have met a problem of Ws-Federation authentication: there is no [Ws-Federation] (https://www.nuget.org/packages?q=Microsoft.Owin.Security.WsFederation) OWIN middleware available in ASP.NET Core platform. But I noticed all authentication middleware for ASP.NET Core are now under Microsoft.AspNetCore.Authentication namespace, so I searched all packages from nuget.org and found most of the authentication packages are there, but

Owin WS-Federation setting up token sliding expiration

心不动则不痛 提交于 2019-12-04 10:14:48
Can somebody explain how to implement sliding expiration using the new Owin WS-Federation plugin? On the client side, at WS-Fedeartion configuration I see that there are some events like : Notifications = new WsFederationAuthenticationNotifications { SecurityTokenReceived = ..., AuthenticationFailed = ..., RedirectToIdentityProvider = ..., MessageReceived = ..., SecurityTokenValidated = .... }, But because the lack of documentation I can't really figure it out where an how? At the moment my STS is issuing tokens with absolute expiration : protected override Lifetime GetTokenLifetime(Lifetime

Add Owin Pipeline Middleware after OwinStartup for new Tenant

人走茶凉 提交于 2019-12-04 08:45:56
I have a multi-tenant application where each tenant can define their own ClientID, Authority, etc for either WsFed or OpenIdConnect. All the tenants are registered in the OwinStartup as below: public void Configuration(IAppBuilder app) { List<WsFederationAuthenticationOptions> WsFedTenantOptions = BuildWsFedTenantOptionsList(); List<OpenIdConnectAuthenticationOptions> OpenIdConnectTenantOptions = BuildOpenIdConnectTenantOptionsList(); app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); app.UseCookieAuthentication(new CookieAuthenticationOptions() {

Prevent XmlHttpRequest redirect response in .Net MVC WS-Federation Site

血红的双手。 提交于 2019-12-04 06:40:27
I'm using WS Federated (Claims Aware) authentication on an MVC 3 site and am having trouble keeping some of my API controllers that send JSON from returning a redirect when the authentication fails. I have an Area called API with several controllers that just return JSON, these controllers all inherit from the same base class. I want to send down legitimate 401 error responses instead of 302 redirects that are happening by default. I followed some directions I found for creating a custom WSFederationAuthenticationModule in concert with a filter I put on my API controller actions: public class

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