Access CustomService from IUmbracoBuilder Composer
I'm trying to implement Google oAuth example witch is compiling but I want to take it one step further and not have client ID and secret hardcoded.
I have a service that gets the content from a settings page and are initializing it inside the builder.
public class RegisterSiteServiceComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.Services.AddScoped<IIBDContentService, IBDContentService>();
builder.AddGoogleAuthentication();
}
}
But how do I inject that into so it can be used from the AddGoogleAuthentication().
.........
// The scheme must be set with this method to work for the back office
var schemeName = backOfficeAuthenticationBuilder.SchemeForBackOffice(GoogleBackOfficeExternalLoginProviderOptions.SchemeName);
OAuthSettings oAuth = _contentService.GetOAuthSettings("Google", "user");
................
Access CustomService from IUmbracoBuilder Composer
I'm trying to implement Google oAuth example witch is compiling but I want to take it one step further and not have client ID and secret hardcoded.
I have a service that gets the content from a settings page and are initializing it inside the builder.
But how do I inject that into so it can be used from the AddGoogleAuthentication().
Have used this https://docs.umbraco.com/umbraco-cms/tutorials/add-google-authentication for implementing all the code.
Is this possible and if so how.
Normally I would do something like this:
is working on a reply...