Commit Graph

94 Commits

Author SHA1 Message Date
Bjarke Berg
a356584eb6 Merge remote-tracking branch 'origin/netcore/dev' into netcore/feature/9623-external-login-token-store
# Conflicts:
#	src/Umbraco.Infrastructure/Configuration/JsonConfigManipulator.cs
2021-03-16 09:14:05 +01:00
Bjarke Berg
b82ea437b7 Merge remote-tracking branch 'origin/netcore/dev' into netcore/feature/remove-backofficeusermanager-static-events 2021-03-15 14:35:46 +01:00
Shannon
e4807c2430 New table and service to store auth tokens
Implements the auth token retrieval and storage for the identity implementation. This is now automatically done for providers and the back office user manager can be used to retreive and store all tokens.

Fixes locking on the config writer.

Removes the abstract NodeObjectTypeId from the base repo since it shouldn't be there.
2021-03-11 19:35:43 +11:00
Bjarke Berg
37ed84871a Merge remote-tracking branch 'origin/v8/dev' into netcore/dev
# Conflicts:
#	build/NuSpecs/UmbracoCms.Core.nuspec
#	build/NuSpecs/UmbracoCms.Web.nuspec
#	src/SolutionInfo.cs
#	src/Umbraco.Core/Cache/CacheKeys.cs
#	src/Umbraco.Core/Composing/TypeFinder.cs
#	src/Umbraco.Core/Configuration/GlobalSettings.cs
#	src/Umbraco.Core/Configuration/GlobalSettingsExtensions.cs
#	src/Umbraco.Core/Configuration/IGlobalSettings.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/ContentElement.cs
#	src/Umbraco.Core/Configuration/UmbracoSettings/ContentSectionExtensions.cs
#	src/Umbraco.Core/Constants-AppSettings.cs
#	src/Umbraco.Core/Editors/UserEditorAuthorizationHelper.cs
#	src/Umbraco.Core/Extensions/StringExtensions.cs
#	src/Umbraco.Core/Extensions/UriExtensions.cs
#	src/Umbraco.Core/IO/IOHelper.cs
#	src/Umbraco.Core/IO/PhysicalFileSystem.cs
#	src/Umbraco.Core/Media/Exif/MathEx.cs
#	src/Umbraco.Core/Media/UploadAutoFillProperties.cs
#	src/Umbraco.Core/Models/Mapping/UserMapDefinition.cs
#	src/Umbraco.Core/Models/Membership/User.cs
#	src/Umbraco.Core/Models/UserExtensions.cs
#	src/Umbraco.Core/Packaging/PackageDefinitionXmlParser.cs
#	src/Umbraco.Core/PropertyEditors/ListViewConfiguration.cs
#	src/Umbraco.Core/PropertyEditors/ValueConverters/MediaPickerValueConverter.cs
#	src/Umbraco.Core/PropertyEditors/ValueConverters/MultiNodeTreePickerValueConverter.cs
#	src/Umbraco.Core/Routing/AliasUrlProvider.cs
#	src/Umbraco.Core/Routing/DefaultUrlProvider.cs
#	src/Umbraco.Core/Routing/UriUtility.cs
#	src/Umbraco.Core/Routing/UrlProviderExtensions.cs
#	src/Umbraco.Core/Runtime/CoreRuntime.cs
#	src/Umbraco.Core/RuntimeOptions.cs
#	src/Umbraco.Core/RuntimeState.cs
#	src/Umbraco.Core/Security/BackOfficeUserStore.cs
#	src/Umbraco.Core/Security/ContentPermissions.cs
#	src/Umbraco.Core/Sync/ApplicationUrlHelper.cs
#	src/Umbraco.Core/Trees/TreeNode.cs
#	src/Umbraco.Core/Udi.cs
#	src/Umbraco.Examine.Lucene/BackOfficeExamineSearcher.cs
#	src/Umbraco.Examine/Umbraco.Examine.csproj
#	src/Umbraco.Infrastructure/Examine/ContentValueSetValidator.cs
#	src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs
#	src/Umbraco.Infrastructure/Packaging/PackageDataInstallation.cs
#	src/Umbraco.Infrastructure/Persistence/SqlSyntax/SqlServerSyntaxProvider.cs
#	src/Umbraco.Infrastructure/Scoping/Scope.cs
#	src/Umbraco.Infrastructure/Search/ExamineComponent.cs
#	src/Umbraco.Infrastructure/Security/IdentityMapDefinition.cs
#	src/Umbraco.Infrastructure/Services/Implement/ContentService.cs
#	src/Umbraco.Infrastructure/Services/Implement/MediaService.cs
#	src/Umbraco.Infrastructure/Services/Implement/NotificationService.cs
#	src/Umbraco.Persistence.SqlCe/SqlCeSyntaxProvider.cs
#	src/Umbraco.Tests.Integration/Umbraco.Infrastructure/Persistence/LocksTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Core/Models/UserExtensionsTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Editors/UserEditorAuthorizationHelperTests.cs
#	src/Umbraco.Tests.UnitTests/Umbraco.Infrastructure/Examine/UmbracoContentValueSetValidatorTests.cs
#	src/Umbraco.Tests/Configurations/UmbracoSettings/ContentElementTests.cs
#	src/Umbraco.Tests/Configurations/UmbracoSettings/umbracoSettings.config
#	src/Umbraco.Tests/TestHelpers/SettingsForTests.cs
#	src/Umbraco.Tests/Testing/TestDatabase.cs
#	src/Umbraco.Tests/Web/Controllers/ContentControllerUnitTests.cs
#	src/Umbraco.Tests/Web/Controllers/FilterAllowedOutgoingContentAttributeTests.cs
#	src/Umbraco.Tests/Web/Controllers/MediaControllerUnitTests.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
#	src/Umbraco.Web.BackOffice/Controllers/CodeFileController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MacrosController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaController.cs
#	src/Umbraco.Web.BackOffice/Controllers/PackageInstallController.cs
#	src/Umbraco.Web.BackOffice/Controllers/TourController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UserGroupEditorAuthorizationHelper.cs
#	src/Umbraco.Web.BackOffice/Filters/FilterAllowedOutgoingContentAttribute.cs
#	src/Umbraco.Web.BackOffice/Filters/FilterAllowedOutgoingMediaAttribute.cs
#	src/Umbraco.Web.BackOffice/Mapping/ContentMapDefinition.cs
#	src/Umbraco.Web.BackOffice/Services/IconService.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeController.cs
#	src/Umbraco.Web.BackOffice/Trees/ContentTreeControllerBase.cs
#	src/Umbraco.Web.BackOffice/Trees/FileSystemTreeController.cs
#	src/Umbraco.Web.BackOffice/Trees/MediaTreeController.cs
#	src/Umbraco.Web.Common/Extensions/FormCollectionExtensions.cs
#	src/Umbraco.Web.UI.Client/src/common/resources/content.resource.js
#	src/Umbraco.Web.UI.Client/src/views/content/overlays/publish.html
#	src/Umbraco.Web.UI.Client/src/views/propertyeditors/grid/editors/media.controller.js
#	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/config/umbracoSettings.Release.config
#	src/Umbraco.Web/Cache/MemberCacheRefresher.cs
#	src/Umbraco.Web/Composing/ModuleInjector.cs
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Editors/Binders/ContentModelBinderHelper.cs
#	src/Umbraco.Web/Editors/ContentTypeController.cs
#	src/Umbraco.Web/Editors/Filters/ContentSaveValidationAttribute.cs
#	src/Umbraco.Web/Editors/Filters/MediaItemSaveValidationAttribute.cs
#	src/Umbraco.Web/Editors/Filters/UserGroupAuthorizationAttribute.cs
#	src/Umbraco.Web/Editors/TinyMceController.cs
#	src/Umbraco.Web/Editors/UserGroupsController.cs
#	src/Umbraco.Web/Editors/UsersController.cs
#	src/Umbraco.Web/ImageCropperTemplateExtensions.cs
#	src/Umbraco.Web/Logging/WebProfiler.cs
#	src/Umbraco.Web/Logging/WebProfilerProvider.cs
#	src/Umbraco.Web/Macros/PublishedContentHashtableConverter.cs
#	src/Umbraco.Web/Mvc/EnsurePublishedContentRequestAttribute.cs
#	src/Umbraco.Web/Mvc/JsonNetResult.cs
#	src/Umbraco.Web/Mvc/MemberAuthorizeAttribute.cs
#	src/Umbraco.Web/Mvc/RenderRouteHandler.cs
#	src/Umbraco.Web/PropertyEditors/MediaPickerPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/MultiNodeTreePickerPropertyEditor.cs
#	src/Umbraco.Web/PublishedCache/NuCache/DataSource/DatabaseDataSource.cs
#	src/Umbraco.Web/RoutableDocumentFilter.cs
#	src/Umbraco.Web/Routing/ContentFinderByUrlAlias.cs
#	src/Umbraco.Web/Routing/NotFoundHandlerHelper.cs
#	src/Umbraco.Web/Routing/PublishedRouter.cs
#	src/Umbraco.Web/Runtime/WebInitialComposer.cs
#	src/Umbraco.Web/Scheduling/KeepAlive.cs
#	src/Umbraco.Web/Security/AppBuilderExtensions.cs
#	src/Umbraco.Web/Security/BackOfficeClaimsIdentityFactory.cs
#	src/Umbraco.Web/Security/Providers/UmbracoMembershipProvider.cs
#	src/Umbraco.Web/Trees/DictionaryTreeController.cs
#	src/Umbraco.Web/Trees/LanguageTreeController.cs
#	src/Umbraco.Web/Trees/LogViewerTreeController.cs
#	src/Umbraco.Web/Trees/PackagesTreeController.cs
#	src/Umbraco.Web/UmbracoApplication.cs
#	src/Umbraco.Web/UmbracoApplicationBase.cs
#	src/Umbraco.Web/UmbracoInjectedModule.cs
#	src/Umbraco.Web/WebApi/Filters/AdminUsersAuthorizeAttribute.cs
#	src/Umbraco.Web/WebApi/Filters/CheckIfUserTicketDataIsStaleAttribute.cs
#	src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForContentAttribute.cs
#	src/Umbraco.Web/WebApi/Filters/EnsureUserPermissionForMediaAttribute.cs
#	src/Umbraco.Web/WebApi/MemberAuthorizeAttribute.cs
2021-03-05 15:36:27 +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
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
428e80f515 Align namespaces in Umbraco.Web.BackOffice 2021-02-10 11:11:18 +01:00
Mole
216fb87c79 Rename Umbraco.Core namespace to Umbraco.Cms.Core 2021-02-09 10:22:42 +01:00
Bjarke Berg
fea86bbf7a Moved the application url to HostingEnvironment and set it in the request middleware 2021-02-08 11:00:15 +01:00
Elitsa Marinovska
b572cf6809 Surrounding ModelState with the newly introduced SimpleValidationModel type 2021-01-13 11:39:44 +01:00
Elitsa Marinovska
9a9f9164e2 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/remove-httpresponseexception
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs
#	src/Umbraco.Web.BackOffice/Controllers/SectionController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
2021-01-13 08:53:41 +01:00
Bjarke Berg
fe016dd103 Netcore: Fixes issues with user invites (#9616)
* AB9629
Fixes issues with user invites
- Issue with the generated link in the invite email
- Allow anonymous access to CurrentUserController.PostSetInvitedUserPassword, as it is used by users not logged in
- Allow anonymous access to AuthenticationController.GetPasswordConfig, as this is used to set a password for newly invited users, before they login

* Fix issues with invite flow

* Fix minor typos

* Fixed issue with validation response and remove/change avatar

* Fix issue with disable users, after all enums are handled like strings

* Fix tests

* Fix other validation issue

* Fix yet another validation issue

Co-authored-by: Elitsa Marinovska <elm@umbraco.dk>
2021-01-12 16:15:19 +01:00
Elitsa Marinovska
b0f4f9f440 Refactoring the use of ValidationErrorResult with the build-in types for status response results 2021-01-12 14:00:14 +01:00
Bjarke Berg
a023d5c55f Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/remove-httpresponseexception
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/EntityController.cs
#	src/Umbraco.Web.Common/Install/InstallApiController.cs
2021-01-05 14:20:32 +01:00
Shannon
1f6297ad6b Moves some services 'up' to Core, moves core DI registrations 'up' to UmbracoBuilder, moves Composing ext to DependencyInjection namespaces as UmbracoBuilder ext 2020-12-24 11:46:17 +11:00
Elitsa Marinovska
358a8ec2af Initial stage of getting rid of HttpResponseException and replacing it with the usage of ValidationErrorResult 2020-12-22 16:36:07 +01: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
d0e17d16bc ext method for authn back office scheme with null check, fixing tests 2020-12-02 15:49:28 +11:00
Shannon
0846fc5690 Cleans up IBackofficeSecurity, ensures authn for the AuthenticationController/BackOfficeController 2020-12-02 14:28:16 +11:00
Shannon
0f0c50b56e Merge remote-tracking branch 'origin/netcore/netcore' into netcore/feature/2FAuth
# Conflicts:
#	src/Umbraco.Tests.Integration/TestServerTest/TestAuthHandler.cs
#	src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentController.cs
#	src/Umbraco.Web.BackOffice/Controllers/ContentTypeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/MediaTypeController.cs
#	src/Umbraco.Web.BackOffice/Controllers/UsersController.cs
#	src/Umbraco.Web.BackOffice/Filters/DenyLocalLoginAuthorizationAttribute.cs
#	src/Umbraco.Web.BackOffice/Filters/OverrideAuthorizationFilterProvider.cs
#	src/Umbraco.Web.Common/Filters/UmbracoBackOfficeAuthorizeAttribute.cs
#	src/Umbraco.Web.Common/Filters/UmbracoBackOfficeAuthorizeFilter.cs
2020-12-02 13:14:47 +11:00
Shannon
999be04285 cleaning up TODOs 2020-12-02 12:22:08 +11:00
Shannon
fe5dcd83bb removes the 2FA store implementation since that will need to be manually enabled 2020-12-01 18:14:37 +11:00
Shannon
20b4f55664 Fixes up a bunch of TODOs moves user manager to the back office project so we have acess to necessary services, splits apart files, removes old code, starts implementing the 2fa stuff 2020-12-01 17:24:23 +11:00
Shannon
efff96f711 Creates IBackOfficeSignInManager interface 2020-11-30 22:46:05 +11:00
Bjarke Berg
5efa93d803 Revert "Revert "FIxes more of the auth procedure""
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-27 13:36:09 +01:00
Bjarke Berg
26dc9219c4 Revert "Revert "Cleans up BackofficeSecurity, fixes up AuthenticationController for endpoints that aren't authorized (and simplifies)""
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-27 13:35:43 +01:00
Bjarke Berg
a098b956a6 Revert "Revert "Ensures that all back office controllers are authenticated under the back office scheme""
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-27 13:35:22 +01:00
Bjarke Berg
d6357e8fde Revert "Revert "Gets oauth working (with google) now need to test others and debug why the styles aren't working""
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-27 13:34:32 +01:00
Bjarke Berg
88c1259d84 Revert "Revert "Moves some files, adds notes, starts poc for back office login providers""
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-27 13:33:01 +01:00
Bjarke Berg
3b0d33a84c Revert "Moves some files, adds notes, starts poc for back office login providers"
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-27 13:17:58 +01:00
Bjarke Berg
1833bfa1a9 Revert "Gets oauth working (with google) now need to test others and debug why the styles aren't working"
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-27 13:17:34 +01:00
Bjarke Berg
7d61020214 Revert "Ensures that all back office controllers are authenticated under the back office scheme"
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-27 13:16:50 +01:00
Bjarke Berg
96ef2fd9b7 Revert "Cleans up BackofficeSecurity, fixes up AuthenticationController for endpoints that aren't authorized (and simplifies)"
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-27 13:16:22 +01:00
Bjarke Berg
348f69734b Revert "FIxes more of the auth procedure"
Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-27 13:15:54 +01:00
Shannon
ec6ac41e56 FIxes more of the auth procedure 2020-11-27 15:58:00 +11:00
Shannon
47ab15f457 Cleans up BackofficeSecurity, fixes up AuthenticationController for endpoints that aren't authorized (and simplifies) 2020-11-27 15:42:41 +11:00
Shannon
313a2e6f7c Ensures that all back office controllers are authenticated under the back office scheme 2020-11-27 13:32:41 +11:00
Shannon
c08db7763e Gets oauth working (with google) now need to test others and debug why the styles aren't working 2020-11-27 00:44:36 +11:00
Shannon
e01abf2802 Moves some files, adds notes, starts poc for back office login providers 2020-11-26 19:24:55 +11:00
Shannon
f313a4f583 some cleanup of handlers that check multiple query strings 2020-11-24 11:56:53 +11:00
Shannon
40d75f88f3 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6666-auth-policies
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/AuthenticationController.cs
#	src/Umbraco.Web.Common/Filters/UmbracoMemberAuthorizeFilter.cs
2020-11-24 00:46:38 +11:00
Shannon
7757447244 Migrates UmbracoBackOfficeAuthorizeAttribute to authz policies and adds notes/questions 2020-11-20 15:32:36 +11:00
Shannon
e7b4c5a811 Converts FeatureAuthorize to authz policy 2020-11-20 12:40:29 +11:00
Shannon
6a995127b1 Migrates AdminUsersAuthorizeAttribute and DenyLocalLoginAuthorizationAttribute to authz policies 2020-11-19 23:53:04 +11:00
Andy Butland
0fbe01cd22 Created new abstraction IUmbracoWebsiteSecurity and migrated controller's using it (replacing MembershipHelper) to Umbraco.Web.Website. 2020-11-18 16:12:42 +01:00
Bjarke Berg
e46a248832 Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller-merge
# Conflicts:
#	src/Umbraco.Infrastructure/HostedServices/ScheduledPublishing.cs
#	src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs
#	src/Umbraco.Infrastructure/Scheduling/SchedulerComponent.cs
#	src/Umbraco.Infrastructure/Scheduling/SchedulerComposer.cs
#	src/Umbraco.Tests.Integration/Testing/UmbracoIntegrationTest.cs
#	src/Umbraco.Tests/Testing/UmbracoTestBase.cs
#	src/Umbraco.Web.BackOffice/Extensions/BackOfficeApplicationBuilderExtensions.cs
#	src/Umbraco.Web.BackOffice/Runtime/BackOfficeComposer.cs
#	src/Umbraco.Web.Common/Runtime/AspNetCoreComposer.cs
#	src/Umbraco.Web.Common/UmbracoContext/UmbracoContext.cs
#	src/Umbraco.Web.UI.NetCore/appsettings.json
#	src/Umbraco.Web/Editors/BackOfficeController.cs
#	src/Umbraco.Web/Runtime/WebInitialComponent.cs
2020-11-12 13:10:19 +01:00
Bjarke Berg
bb1b04be15 Netcore: Cleanup and migrate few classes from Umbraco.Web (#9375)
* Migrated a few classes, and cleaned up by removing some old classs too in the Umbraco.Web Project

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Migrated a few classes, and cleaned up by removing some old classs too in the Umbraco.Web Project

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Moved SurfaceControllerTypeCollection + Builder

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Moved Extension methods

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

* Removed Wrap methods.. People should use their own TagBuilder

Signed-off-by: Bjarke Berg <mail@bergmania.dk>
2020-11-12 11:01:19 +01:00
Bjarke Berg
715071a33f Merge remote-tracking branch 'origin/netcore/task/6973-migrating-authenticationcontroller' into netcore/task/6973-migrating-authenticationcontroller-merge
# Conflicts:
#	src/Umbraco.Web.BackOffice/Controllers/BackOfficeServerVariables.cs
#	src/Umbraco.Web.BackOffice/Extensions/BackOfficeApplicationBuilderExtensions.cs
#	src/Umbraco.Web/Logging/WebProfilerComponent.cs
#	src/Umbraco.Web/Logging/WebProfilerComposer.cs
2020-10-26 14:37:56 +01:00