Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
So I have a class that inherits from UmbracoDefaultOwinStartup its in an inherited site. Its making use of content service to get some config stuff.
Is it possible to inject in IUmbracoContextFactory then I can use the cache to do the same thing or is this to early in the pipleine?
Not sure if you've seen my reply on slack, but instead of overwriting UmbracoDefaultOwinStartup you can create a component and listen to the UmbracoDefaultOwinStartup.MiddlewareConfigured event. This event is fired when Umbraco is done configuring Owin
public class MyComposer : ComponentComposer<MyComponent>, IUserComposer
public class MyComponent : IComponent
// inject dependencies in the constructor
public void Initialize()
UmbracoDefaultOwinStartup.MiddlewareConfigured += (_, e) => ConfigureMiddleware(e.AppBuilder);
private void ConfigureMiddleware(IAppBuilder app)
// this is called when Umbraco is done configuring the Owin middleware
public void Terminate()
Hmm, but i need todo this:
protected override void ConfigureUmbracoAuthentication(IAppBuilder app)
what maybe i cannot do in the composer?
It's AFAIK not possible to inject stuff into the OwinStartup class But looking at the UmbracoDefaultOwinStartup, ConfigureUmbracoAuthentication() is called right before the event is triggered https://github.com/umbraco/Umbraco-CMS/blob/8f32fce7818a556d4879e66851dbe91221c63fdc/src/Umbraco.Web/UmbracoDefaultOwinStartup.cs#L69 (the FinalizeMiddlewareConfiguration triggers the event)
So you should be able to run you're auth configuration in the ConfigureMiddleware method in the Component example shown above
Awesomes will give that a whirl, thanks for you help.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted