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.
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!
Did you manage to resolve this?
is working on a reply...