asp.net mvc - Setup OWIN dynamically (by domain) -
we trying setup white label on our project uses owin(includes fb, google, live logins). there way setup api credential dynamically, if changes domain settings change.
i think owin loads earlier mvc? there way can load on global.asax(request)?
public partial class startup { public void configuration(iappbuilder app) { configureauth(app); } }
update:
in other words single application host many domains , sub domains(white labeling).
i have been googling on same things today. found nice owin sample @ http://aspnet.codeplex.com/sourcecontrol/latest#samples/katana/branchingpipelines/branchingpipelines.sln explained branching capabilities of owin. if understand sample correctly, should able configure different owin stacks depending on request parameters such host header, cookie, path or whatever using app.map() or app.mapwhen() methods.
let's have 2 different dns domains representing 2 customers different login configs, can initialize owin use different configs depending on value of host header:
public class startup { public void configuration(iappbuilder app) { app.mapwhen(ctx => ctx.request.headers.get("host").equals("customer1.cloudservice.net"), app2 => { app2.usewsfederationauthentication(...); }); app.mapwhen(ctx => ctx.request.headers.get("host").equals("customer2.cloudservice.net"), app2 => { app2.usegoogleauthentication(...); }); } }
Comments
Post a Comment