Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tomás Jesús Soler Ramírez 4 posts 75 karma points
    Sep 24, 2019 @ 08:20
    Tomás Jesús Soler Ramírez
    1

    Injecting services into UmbracoDefaultOwinStartup

    Hi all,

    I'm trying to implement a third party auth for both backoffice and front members. I have a service that I have created that contains most of the logic and now I want to inject it. I have tried a couple of things:

    1) Based off this thread I have created a component and injected my service into the constructor, but it just does nothing. The button on the backoffice is not showing and the frontend doesn't even recognise the auth type.

    2) ~~I extended UmbracoDefaultOwinStartup and created 2 constructors, one for my injected service, and one with no parameters. (If I just have the one with the injection, YSOD complaining about it). Now, in theory this shouldn't work at all, but the fact is it works in the backoffice and not in the front. (I've just realised the front member might be because of an unralted issue and will test tomorrow.)~~ EDIT: NO, it doesn't work, the information was being received from other places, but in fact the service passed through the second constructor is null.

    Question is, what would be the proper way to register a third party auth system that has a bunch of logic? We obviously extracted that logic to a service and we are using it in other places, so we should keep the service. If we just duplicate all the service logic into the extension of UmbracoDefaultOwinStartup, it works perfectly fine.

    Thanks!

  • Shane Marsden 12 posts 74 karma points
    Oct 15, 2019 @ 10:19
    Shane Marsden
    0

    Did you manage to resolve this?

Please Sign in or register to post replies

Write your reply to:

Draft