Commit Graph

22 Commits

Author SHA1 Message Date
Bjarke Berg
852305b7d1 Simplified setup of 2FA for users (#12142)
* Added functionality to enable 2FA for users..

* Do not use the obsolete ctor in tests

* cleanup

* Cleanup

* Convert User view from overlay to infinite editor

* Add support for having additional editors on top of the user (2fa) which overlay does not support
* Add controllerAs syntax in the template
* Remove unused dependencies

* Adjustments to 2fa login view

* organize elements
* add translations
* add a11y helpers
* add autocompletion = one-time-code
* change to controllerAs syntax

* add callback to cancel 2fa and fix error where submit button was not reset when all other validations were

* add a cancel/go back button to the 2fa view

* replace header with something less obstrusive

* move logout button to the footer in the new editor view

* change 'edit profile' to an umb-box and move ng-if for password fields out to reduce amount of checks

* Add umb-box to external login provider section

* add umb-box to user history section

* bug: fix bug where notificationsService would not allow new notifications if removeAll had been called

* add styling and a11y to configureTwoFactor view

- also ensure that the view reloads when changes happen in the custom user view to enable 2fa
- ensure that view updates when disabling 2fa
- add extra button to show options (disable) for each 2fa provider

* add notification when 2fa is disabled

* add data-element to support the intro tour

also changed a minor selector in the cypress test

* correct usage of umb-box with umb-box-content

* do not use the .form class twice to prevent double box-shadow

* make tranlastion for 2fa placeholder shorter

* ensure that field with 2fa provider is always visible when more than 1 provider

* move error state of 2fa field to token field

* update translation of multiple 2fa providers

* move CTA buttons to right side to follow general UI practices

* rename options to disable

* add disabled state

* add helper folders to gitignore so you can work with plugins and custom code without committing it accidentally

* move the disable functionality to its own infinite editor view

* use properties from umb-control-group correctly

* add 'track by' to repeater

* make use of umb-control-group

* remove unused functions

* clean up translations

* add Danish translations

* copy translations to english

* Only return enabled 2fa providers as expected

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2022-04-19 08:33:03 +02:00
Bjarke Berg
2baa1abfc4 Merge remote-tracking branch 'origin/v8/8.16' into v9/feature/merge_v8_11082021
# Conflicts:
#	.github/CONTRIBUTING.md
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	build/NuSpecs/UmbracoCms.Web.nuspec
#	build/NuSpecs/UmbracoCms.nuspec
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Cache/AppCaches.cs
#	src/Umbraco.Core/Cache/AppPolicedCacheDictionary.cs
#	src/Umbraco.Core/Cache/DeepCloneAppCache.cs
#	src/Umbraco.Core/Cache/WebCachingAppCache.cs
#	src/Umbraco.Core/CompositionExtensions.cs
#	src/Umbraco.Core/Models/Identity/BackOfficeIdentityUser.cs
#	src/Umbraco.Core/Models/PropertyGroupCollection.cs
#	src/Umbraco.Core/Models/PropertyTypeCollection.cs
#	src/Umbraco.Core/Persistence/Repositories/Implement/ExternalLoginRepository.cs
#	src/Umbraco.Core/ReadLock.cs
#	src/Umbraco.Core/Routing/SiteDomainMapper.cs
#	src/Umbraco.Core/UpgradeableReadLock.cs
#	src/Umbraco.Core/WriteLock.cs
#	src/Umbraco.Examine/ExamineExtensions.cs
#	src/Umbraco.Infrastructure/Examine/UmbracoFieldDefinitionCollection.cs
#	src/Umbraco.Infrastructure/Persistence/Dtos/ContentTypeDto.cs
#	src/Umbraco.Infrastructure/Persistence/Dtos/DictionaryDto.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberGroupRepository.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/TemplateRepository.cs
#	src/Umbraco.Infrastructure/Persistence/Repositories/Implement/UserRepository.cs
#	src/Umbraco.Infrastructure/Services/IdKeyMap.cs
#	src/Umbraco.Infrastructure/Services/Implement/ContentService.cs
#	src/Umbraco.ModelsBuilder.Embedded/PureLiveModelFactory.cs
#	src/Umbraco.Tests/App.config
#	src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
#	src/Umbraco.Web.UI.Client/package.json
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/da.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI.NetCore/umbraco/config/lang/en_us.xml
#	src/Umbraco.Web.UI/Umbraco.Web.UI.csproj
#	src/Umbraco.Web.UI/Umbraco/config/lang/cy.xml
#	src/Umbraco.Web.UI/web.Template.config
#	src/Umbraco.Web/CacheHelperExtensions.cs
#	src/Umbraco.Web/Editors/RelationTypeController.cs
#	src/Umbraco.Web/Logging/WebProfilerProvider.cs
#	src/Umbraco.Web/Models/Mapping/MemberMapDefinition.cs
#	src/Umbraco.Web/PublishedCache/NuCache/MemberCache.cs
#	src/Umbraco.Web/Routing/ContentFinderByConfigured404.cs
#	src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs
#	src/Umbraco.Web/Security/BackOfficeUserManager.cs
#	src/Umbraco.Web/Umbraco.Web.csproj
2021-08-11 19:11:35 +02:00
Mole
2bf86acf38 V9: Place notifications in the same namespace (#10231)
* Gather all notifications in Umbraco.Cms.Core.Notifications

* Rename notifications to match convention

* Move and rename missed notifications

* Move the three remaining public notification into Umbraco.Cms.Core.Notifications
2021-05-11 14:33:49 +02:00
Shannon Deminick
de28fbb0a4 Member password roll forward (#10138)
* Getting new netcore PublicAccessChecker in place

* Adds full test coverage for PublicAccessChecker

* remove PublicAccessComposer

* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller

* Implements the required methods on IMemberManager, removes old migrated code

* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops

* adds note

* adds note

* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.

* Changes name to IUmbracoEndpointBuilder

* adds note

* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect

* fixing build

* Updates user manager to correctly validate password hashing and injects the IBackOfficeUserPasswordChecker

* Merges PR

* Fixes up build and notes

* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.

* adds note

* removes unused filter, fixes build

* fixes WebPath and tests

* Looks up entities in one query

* remove usings

* Fix test, remove stylesheet

* Set status code before we write to response to avoid error

* Ensures that users and members are validated when logging in. Shares more code between users and members.

* Fixes RepositoryCacheKeys to ensure the keys are normalized

* oops didn't mean to commit this

* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy

* oops didn't mean to comit this

* bah, far out this keeps getting recommitted. sorry

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 07:45:35 +02:00
Shannon Deminick
a1624d26a3 Implements Public Access in netcore (#10137)
* Getting new netcore PublicAccessChecker in place

* Adds full test coverage for PublicAccessChecker

* remove PublicAccessComposer

* adjust namespaces, ensure RoleManager works, separate public access controller, reduce content controller

* Implements the required methods on IMemberManager, removes old migrated code

* Updates routing to be able to re-route, Fixes middleware ordering ensuring endpoints are last, refactors pipeline options, adds public access middleware, ensures public access follows all hops

* adds note

* adds note

* Cleans up ext methods, ensures that members identity is added on both front-end and back ends. updates how UmbracoApplicationBuilder works in that it explicitly starts endpoints at the time of calling.

* Changes name to IUmbracoEndpointBuilder

* adds note

* Fixing tests, fixing error describers so there's 2x one for back office, one for members, fixes TryConvertTo, fixes login redirect

* fixing build

* Fixes keepalive, fixes PublicAccessMiddleware to not throw, updates startup code to be more clear and removes magic that registers middleware.

* adds note

* removes unused filter, fixes build

* fixes WebPath and tests

* Looks up entities in one query

* remove usings

* Fix test, remove stylesheet

* Set status code before we write to response to avoid error

* Ensures that users and members are validated when logging in. Shares more code between users and members.

* Fixes RepositoryCacheKeys to ensure the keys are normalized

* oops didn't mean to commit this

* Fix casing issues with caching, stop boxing value types for all cache operations, stop re-creating string keys in DefaultRepositoryCachePolicy

* bah, far out this keeps getting recommitted. sorry

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2021-04-20 07:11:45 +02:00
Kenn Jacobsen
335a62164c Audit the last few backoffice user events 2021-03-02 08:13:59 +01:00
Kenn Jacobsen
90031b83b0 Replaced static events in BackOfficeUserManager with IEventAggregator notifications and removed various unused or obsolete events (i.e. user invitation events) 2021-02-26 16:37:34 +01:00
Bjarke Berg
dc4595b16a Merge remote-tracking branch 'origin/netcore/dev' into netcore/feature/align-infrastructure-namespaces
# Conflicts:
#	src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs
#	src/Umbraco.Tests/TestHelpers/ControllerTesting/AuthenticateEverythingMiddleware.cs
#	src/Umbraco.Tests/TestHelpers/ControllerTesting/TestControllerActivatorBase.cs
2021-02-23 12:07:22 +01:00
Mole
159747ab61 Merge remote-tracking branch 'origin/netcore/dev' into netcore/feature/align-infrastructure-namespaces
# Conflicts:
#	src/Umbraco.Infrastructure/Cache/DistributedCacheBinder_Handlers.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.MappingProfiles.cs
#	src/Umbraco.Infrastructure/PropertyEditors/PropertyEditorsComponent.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs
#	src/Umbraco.Infrastructure/Security/IBackOfficeUserManager.cs
#	src/Umbraco.Infrastructure/Security/IUmbracoUserManager.cs
#	src/Umbraco.Infrastructure/Security/SignOutAuditEventArgs.cs
#	src/Umbraco.Infrastructure/Security/UmbracoUserManager.cs
#	src/Umbraco.Infrastructure/Security/UserInviteEventArgs.cs
#	src/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackOffice/BackOfficeLookupNormalizerTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/MemberController.cs
#	src/Umbraco.Web/Security/IBackOfficeUserPasswordChecker.cs
#	src/Umbraco.Web/Security/Providers/MembersRoleProvider.cs
2021-02-23 08:51:09 +01:00
Mole
9d0493d38f Merge remote-tracking branch 'origin/netcore/dev' into 9622-remove-backofficeidentity
# Conflicts:
#	src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs
2021-02-23 08:29:03 +01:00
Emma Garland
2109bee83b Merge branch 'netcore/dev' into netcore/members-userstore
# Conflicts:
#	src/Umbraco.Core/Models/Membership/IMembershipUser.cs
#	src/Umbraco.Core/Models/Membership/IUser.cs
#	src/Umbraco.Core/Services/IMembershipRoleService.cs
#	src/Umbraco.Infrastructure/Compose/AuditEventsComponent.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.MappingProfiles.cs
#	src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs
#	src/Umbraco.Infrastructure/Install/InstallSteps/NewInstallStep.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeIdentityUser.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeUserStore.cs
#	src/Umbraco.Infrastructure/Security/IBackOfficeUserPasswordChecker.cs
#	src/Umbraco.Infrastructure/Security/IUmbracoUserManager.cs
#	src/Umbraco.Infrastructure/Security/IdentityMapDefinition.cs
#	src/Umbraco.Infrastructure/Security/SignOutAuditEventArgs.cs
#	src/Umbraco.Infrastructure/Security/UmbracoUserManager.cs
#	src/Umbraco.Infrastructure/Services/Implement/MemberService.cs
#	src/Umbraco.Tests.Integration/TestServerTest/TestAuthHandler.cs
#	src/Umbraco.Tests.Integration/Umbraco.Web.BackOffice/UmbracoBackOfficeServiceCollectionExtensionsTests.cs
#	src/Umbraco.Tests.UnitTests/AutoFixture/AutoMoqDataAttribute.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackOffice/BackOfficeClaimsPrincipalFactoryTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/BackOffice/BackOfficeLookupNormalizerTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Security/NoOpLookupNormalizerTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Controllers/UsersControllerTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MemberController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.BackOffice/DependencyInjection/ServiceCollectionExtensions.cs
#	src/Umbraco.Web.BackOffice/Filters/CheckIfUserTicketDataIsStaleAttribute.cs
#	src/Umbraco.Web.BackOffice/Mapping/MemberMapDefinition.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficePasswordHasher.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficeSecurityStampValidator.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficeSessionIdValidator.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficeSignInManager.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficeUserManagerAuditer.cs
#	src/Umbraco.Web.BackOffice/Security/ConfigureBackOfficeIdentityOptions.cs
#	src/Umbraco.Web.BackOffice/Security/ExternalSignInAutoLinkOptions.cs
#	src/Umbraco.Web.BackOffice/Security/IBackOfficeSignInManager.cs
#	src/Umbraco.Web.BackOffice/Security/PasswordChanger.cs
#	src/Umbraco.Web.Common/DependencyInjection/ServiceCollectionExtensions.cs
#	src/Umbraco.Web.Common/Middleware/BootFailedMiddleware.cs
#	src/Umbraco.Web.Common/Security/BackOfficeUserManager.cs
#	src/Umbraco.Web/Security/MembershipHelper.cs
#	src/Umbraco.Web/Security/MembershipProviderBase.cs
#	src/Umbraco.Web/Security/Providers/MembersMembershipProvider.cs
#	src/Umbraco.Web/Security/Providers/MembersRoleProvider.cs
#	src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs
2021-02-22 20:55:12 +00:00
Mole
d413bf49f9 Merge remote-tracking branch 'origin/netcore/dev' into 9622-remove-backofficeidentity
# Conflicts:
#	src/Umbraco.Core/Security/AuthenticationExtensions.cs
#	src/Umbraco.Core/Security/UmbracoBackOfficeIdentity.cs
#	src/Umbraco.Infrastructure/Security/BackOfficeClaimsPrincipalFactory.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/BackOffice/UmbracoBackOfficeIdentityTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Extensions/ClaimsPrincipalExtensionsTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Web.BackOffice/Security/BackOfficeAntiforgeryTests.cs
#	src/Umbraco.Tests/TestHelpers/ControllerTesting/AuthenticateEverythingMiddleware.cs
#	src/Umbraco.Web.BackOffice/Security/BackOfficeSecureDataFormat.cs
#	src/Umbraco.Web.BackOffice/Security/ConfigureBackOfficeCookieOptions.cs
#	src/Umbraco.Web.Common/Security/BackOfficeUserManager.cs
2021-02-22 08:38:12 +01:00
Mole
bf41c2eeaa Netcore: Align namespaces (#9801)
* Rename Umbraco.Core namespace to Umbraco.Cms.Core

* Move extension methods in core project to Umbraco.Extensions

* Move extension methods in core project to Umbraco.Extensions

* Rename Umbraco.Examine namespace to Umbraco.Cms.Examine

* Move examine extensions to Umbraco.Extensions namespace

* Reflect changed namespaces in Builder and fix unit tests

* Adjust namespace in Umbraco.ModelsBuilder.Embedded

* Adjust namespace in Umbraco.Persistence.SqlCe

* Adjust namespace in Umbraco.PublishedCache.NuCache

* Align namespaces in Umbraco.Web.BackOffice

* Align namespaces in Umbraco.Web.Common

* Ensure that SqlCeSupport is still enabled after changing the namespace

* Align namespaces in Umbraco.Web.Website

* Align namespaces in Umbraco.Web.UI.NetCore

* Align namespaces in Umbraco.Tests.Common

* Align namespaces in Umbraco.Tests.UnitTests

* Align namespaces in Umbraco.Tests.Integration

* Fix errors caused by changed namespaces

* Fix integration tests

* Undo the Umbraco.Examine.Lucene namespace change

This breaks integration tests on linux, since the namespace wont exists there because it's only used on windows.

* Fix merge

* Fix Merge
2021-02-18 11:06:02 +01:00
Mole
33a99df73f Remove usage of FromClaimsIdentity 2021-02-17 11:50:19 +01:00
Mole
30b086d5d0 Align namespaces in Security to Umbraco.Cms.Core 2021-02-15 12:01:12 +01:00
Mole
55aa2edb72 Align namespaces in Umbraco.Web.Common 2021-02-10 11:42:04 +01:00
Mole
216fb87c79 Rename Umbraco.Core namespace to Umbraco.Cms.Core 2021-02-09 10:22:42 +01:00
Emma Garland
8caf2a0e62 Initial check in of roles work in the store. Not currently functional 2021-01-29 16:43:50 +00:00
Emma Garland
d285f626a0 Pull request peer review changes - renamed password method, removed unneeded non-strongly typed Member GetAllRoles() method, removed duplicate Normalizer test and rename normalizer, removed currently unneeded events on MembersUserManager. Fixed namespaces and ensured tests in correct location. 2021-01-11 14:24:49 +00:00
Shannon
5172b0e58a Updates user manager, user store and identity user to use the aspnetcore base classes instead of copies of our own, uses string ids for user and roles to simplify everything and to allow for sharing between members 2020-12-04 12:44:27 +11:00
Shannon
86d231f5de removes remaining back office things from underlying UmbracoUserManager moves files 2020-12-04 02:21:21 +11:00
Shannon
35af86c3d3 Splits user manager into a base class that can be reused changes base class of IdentityUser to UmbracoIdentityUser 2020-12-04 01:38:36 +11:00