owin

Reuse Claim in regenerateIdentityCallback in Owin Identity in MVC5

自古美人都是妖i 提交于 2020-01-01 08:43:08
问题 I am using MVC5 with Owin identity. I am struggling to reuse any custom Claims in regenerateIdentityCallback. I have in Startup this configuration (as provided in the standard Template for new MVC project) app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Login"), Provider = new CookieAuthenticationProvider { OnValidateIdentity = SecurityStampValidator.OnValidateIdentity

OWIN with LDAP Authentication

旧时模样 提交于 2020-01-01 05:21:07
问题 Here is my scenario. I have an MVC 5 application that uses Owin as an authentication mechanism. The default template calls the SignInManager.PasswordSignInAsync in the Login action which I would like to overwrite to use LDAP to validate the user instead of looking into the database. I am able to do the validation via: PrincipalContext dc = new PrincipalContext(ContextType.Domain, "domain.com", "DC=domain,DC=com", "user_name", "password"); bool authenticated = dc.ValidateCredentials(userName,

Are Microsoft.Owin types like OwinMiddleware and IOwinContext incompatible with other Owin servers?

假如想象 提交于 2020-01-01 04:11:07
问题 If I build an OWIN middleware using Microsoft.Owin types like OwinMiddleware and IOwinContext, would my middleware work with non-Microsoft Owin hosts/servers? I'm looking at the middleware classes for Nancy and SignalR and they seem very different from the OwinMiddleware base class that middlewares like the Cookie authentication middleware and WebApi is based on. I'm reading the spec but I'm still not clear if a non-Microsoft Owin server could work with the OwinMiddleware and IOwinContext

How to get OwinContext from Global.asax?

蓝咒 提交于 2020-01-01 04:07:28
问题 I am trying to set up my Dependency Injection and I am in the need of injecting a IAuthenticationManager from ASP.NET Identity to an OwinContext . For this I am from my Global.asax -> ServiceConfig.Configure() running: container.Register(() => HttpContext.Current.GetOwinContext().Authentication); But when I am running my application I get this message: No owin.Environment item was found in the context Why is this HttpContext.Current.GetOwinContext() not available from Global.asax? Startup.cs

How to get OwinContext from Global.asax?

怎甘沉沦 提交于 2020-01-01 04:07:07
问题 I am trying to set up my Dependency Injection and I am in the need of injecting a IAuthenticationManager from ASP.NET Identity to an OwinContext . For this I am from my Global.asax -> ServiceConfig.Configure() running: container.Register(() => HttpContext.Current.GetOwinContext().Authentication); But when I am running my application I get this message: No owin.Environment item was found in the context Why is this HttpContext.Current.GetOwinContext() not available from Global.asax? Startup.cs

Is it possible to set an ASP.NET Owin security cookie's ExpireTimeSpan on a per-user basis?

落花浮王杯 提交于 2020-01-01 04:05:08
问题 We have an ASP.NET MVC 5 app using Owin cookie authentication. Currently, we set up cookie authentication as follows: public partial class Startup { public void ConfigureAuth(IAppBuilder app) { var timeoutInMinutes = int.Parse(ConfigurationManager.AppSettings["cookie.timeout-minutes"]); app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, AuthenticationMode = AuthenticationMode.Active, LoginPath = new PathString("/"),

Complex Claim Values in .NET Framework with System.Security.Claims

只愿长相守 提交于 2020-01-01 02:39:09
问题 I'm developing a web app with Asp.Net 5 MVC, Owin and Oauth2 bearer token as auth type. Following this guide that adds a custom complex claim Json serialized to an instance of Microsoft.IdentityModel.Claims.ClaimsIdentity with success, I've tried to replicate the same example using the ClaimsIdentity on the System.Security.Claims namespace. Unluckily, it seems that adding a complexClaim to the ClaimsIdentity instance, the derived class type information is lost, and the claim is stored as a

ASP.NET Identity: Update external claims after authorization

主宰稳场 提交于 2020-01-01 02:30:06
问题 I am using ASP.NET Identity with several external login providers and I need to handle the following scenario: 1) A user logs in using an external service (let's say it is Facebook), application grabs some info from Facebook (first and last name, email, date of birth, etc...) Claims containing this info are added to the identity. 2) I need to store this info in the application Db, for the following scenarios: Admin browses the list of registered users Email subscription service will use first

OWIN middleware for OpenID Connect - Code flow ( Flow type - AuthorizationCode) documentation?

家住魔仙堡 提交于 2019-12-31 22:22:59
问题 In my implementation I am using OpenID-Connect Server (Identity Server v3+) to authenticate Asp.net MVC 5 app (with AngularJS front-end) I am planning to use OID Code flow (with Scope Open_ID) to authenticate the client (RP). For the OpenID connect middle-ware, I am using OWIN (Katana Project) components. Before the implementation, I want to understand back-channel token request, refresh token request process, etc using OWIN.. But I am unable to find any documentation for this type of

OWIN middleware for OpenID Connect - Code flow ( Flow type - AuthorizationCode) documentation?

一个人想着一个人 提交于 2019-12-31 22:22:09
问题 In my implementation I am using OpenID-Connect Server (Identity Server v3+) to authenticate Asp.net MVC 5 app (with AngularJS front-end) I am planning to use OID Code flow (with Scope Open_ID) to authenticate the client (RP). For the OpenID connect middle-ware, I am using OWIN (Katana Project) components. Before the implementation, I want to understand back-channel token request, refresh token request process, etc using OWIN.. But I am unable to find any documentation for this type of