I'm working on adding Active Directory back office login (and eventually AD access for protected pages) to an Umbraco 8 website. I've been using https://our.umbraco.com/documentation/Reference/Security/authenticate-with-AD as a starting point. The ConfigureUserManagerForUmbracoBackOffice function uses an ApplicationContext object but it doesn't seem to be a part of the Umbraco.Core namespace in Umbraco 8. I saw another article that suggested the singleton ApplicationContext.current was to be avoided. Has it been moved, or am I making a mistake? Thanks in advance!
app.ConfigureUserManagerForUmbracoBackOffice<BackOfficeUserManager, BackOfficeIdentityUser>(
applicationContext,
(options, context) =>
{
var membershipProvider = Umbraco.Core.Security.MembershipProviderExtensions.GetUsersMembershipProvider().AsUmbracoMembershipProvider();
var settingContent = Umbraco.Core.Configuration.UmbracoConfig.For.UmbracoSettings().Content;
var userManager = BackOfficeUserManager.Create(
options,
Umbraco.Core.Composing.Current.Services.UserService,
Umbraco.Core.Composing.Current.Services.EntityService,
Umbraco.Core.Composing.Current.Services.ExternalLoginService,
membershipProvider,
settingContent
);
userManager.BackOfficeUserPasswordChecker = new ActiveDirectoryBackOfficeUserPasswordChecker();
return userManager;
});
I get an error about not finding a correctly formed userManager argument. I'm also curious about the applicationContext as an argument since I wouldn't be getting it from ApplicationContext.Current.
I'm not quite sure what i should be looking at? :)
Currently getting this error which looks alot like the one above,
There is no argument given that corresponds to the required formal parameter 'userManager' of 'AppBuilderExtensions.ConfigureUserManagerForUmbracoBackOffice<TManager, TUser>(IAppBuilder, IRuntimeState, IGlobalSettings, Func<IdentityFactoryOptions<TManager>, IOwinContext, TManager>)'
ApplicationContext.current in Umbraco 8
I'm working on adding Active Directory back office login (and eventually AD access for protected pages) to an Umbraco 8 website. I've been using https://our.umbraco.com/documentation/Reference/Security/authenticate-with-AD as a starting point. The ConfigureUserManagerForUmbracoBackOffice function uses an ApplicationContext object but it doesn't seem to be a part of the Umbraco.Core namespace in Umbraco 8. I saw another article that suggested the singleton ApplicationContext.current was to be avoided. Has it been moved, or am I making a mistake? Thanks in advance!
In Umbraco 8 you can access the Umbraco services with:
Thank you! Just looking to clarify. When I implement ConfigureUserManagerForUmbracoBackOffice like this:
I get an error about not finding a correctly formed userManager argument. I'm also curious about the applicationContext as an argument since I wouldn't be getting it from ApplicationContext.Current.
Hi Sekou,
The signature of this method has changed in V8.
Here is a example from core : https://github.com/umbraco/Umbraco-CMS/blob/d0b9fb7d6fdbee3116ae98e056dd4ac108a28d4f/src/Umbraco.Web/Security/AppBuilderExtensions.cs
Dave
Hi Dave,
I'm not quite sure what i should be looking at? :)
Currently getting this error which looks alot like the one above,
Hey Dave and Corné, I decided to go a different route and used Azure Active Directory login with the IdentityExtensions package. Thanks!
We found a solution :)
For reference use :)
iam using this mway in umbraco 13 guid
is working on a reply...