Commit Graph

14 Commits

Author SHA1 Message Date
Nikolaj Geisle
595ee242aa V14: Remove old backoffice project. (#15752)
* Move magical route to management api

* Move auth around

* Remove "New" cookies, as they are no longer needed

* Move all installer related

* Remove BackOfficeServerVariables.cs and trees

* Move webhooks to management api

* Remove remainting controllers

* Remove last services

* Move preview to management api

* Remove mroe extensions

* Remove tours

* Remove old Auth handlers

* Remove server variables entirely

* Remove old backoffice controller

* Remove controllers namespace entirely

* Move rest of preview

* move last services

* Move language file extension

* Remove old backoffice entirely (Backoffice and Web.UI projects)

* Clean up unused security classes

* Fix up installer route

* Remove obsolete tests

* Fix up DI in integration test

* Add missing property mapping

* Move core mapping into core

* Add composers to integration test

* remove identity

* Fix up DI

* Outcomment failing test :)

* Fix up remaining test

* Update mapper

* Remove the actual project files

* Remove backoffice cs proj

* Remove old backoffice from yml

* Run belissima before login

* Remove caching

* Refactor file paths

* Remove belle from static assets

* Dont refer to old project in templates

* update gitignore

* Add missing files

* Remove install view as its no longer used

* Fix up failing test

* Remove outcommented code

* Update submodule to latest

* fix build

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
2024-02-27 12:40:30 +01:00
Elitsa Marinovska
8c6e03d346 V14: Invalidate user tokens (#15651)
* Adding revoke user auth token handler and registering it

* Maintain method clarity by grouping new calls into its own method

* Rename functions to what they do

* Suggested linq function of tripple nesting

* Reduce nesting by early loop continuation

* Fix PR suggestion async typo

* Review suggestions

* Log msg alignment between members and users

---------

Co-authored-by: Sven Geusens <sge@umbraco.dk>
2024-02-06 13:02:35 +01:00
Bjarke Berg
aaca7a5ff4 2FA for users in management API (#15607)
* Added 2FA management endpoints

* Ensure not found do not lead to forbidden results

* Do not inherit the requirement to have access to users, from the current user base class

* Updated OpenApi.json

* Handle 2FA in login scenario (only backend)

* Added the endpoint to use for client to post 2FA code

* Fixed tests and allow injecting the authentication type settings

* fix test build

* Fallback to use Constants.Security.BackOfficeAuthenticationType

* remove unused variable

* Review fixes

* Build fix

* Update src/Umbraco.Cms.Api.Management/Controllers/User/Current/DisableTwoFactorProviderCurrentUserController.cs

Co-authored-by: Sven Geusens <geusens@gmail.com>

* Handle case where 2fa provider is already setup

---------

Co-authored-by: Sven Geusens <geusens@gmail.com>
2024-01-23 18:07:21 +01:00
Kenn Jacobsen
83321a8fad Add member auth to the Delivery API (#14730)
* Refactor OpenIddict for shared usage between APIs + implement member authentication and handling within the Delivery API

* Make SwaggerRouteTemplatePipelineFilter UI config overridable

* Enable token revocation + rename logout endpoint to signout

* Add default implementation of SwaggerGenOptions configuration for enabling Delivery API member auth in Swagger

* Correct notification handling when (un)protecting content

* Fixing integration test framework

* Cleanup test to not execute some composers twice

* Update paths to match docs

* Return Forbidden when a member is authorized but not allowed to access the requested resource

* Cleanup

* Rename RequestMemberService to RequestMemberAccessService

* Rename badly named variable

* Review comments

* Hide the auth controller from Swagger

* Remove semaphore

* Add security requirements for content API operations in Swagger

* Hide the back-office auth endpoints from Swagger

* Fix merge

* Update back-office API auth endpoint paths + add revoke and sign-out endpoints (as of now they do not exist, a separate task will fix that)

* Swap endpoint order to maintain backwards compat with the current login screen for new back-office (will be swapped back again to ensure correct .well-known endpoints, see FIXME comment)

* Make "items by IDs" endpoint support member auth

* Add 401 and 403 to "items by IDs" endpoint responses

---------

Co-authored-by: Bjarke Berg <mail@bergmania.dk>
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-09-26 09:22:45 +02:00
Elitsa Marinovska
036876f349 V14: Add authorization policies to new Backoffice API controllers - p1 (#14551)
* AuditLog policies

* DataType policies

* Dictionary policies

* Document controllers policies

* DocumentBlueprint controllers policies

* DocumentType controllers policies

* HealthCheck controllers policies

* Language controllers policies

* LogViewer controllers policies

* Media controllers policies

* MediaType controllers policies

* Member controllers policies

* MemberGroup controllers policies

* MemberType controllers policies

* ModelsBuilder controllers policies

* Package controllers policies

* PartialView controllers policies

* Profiling controllers policies

* PropertyType controllers policies

* RedirectUrlManagement controllers policies

* Relation controllers policies

* RelationType controllers policies

* Script controllers policies

* Stylesheet controllers policies

* Telemetry controllers policies

* Template controllers policies

* TrackedReference controllers policies

* Upgrade controllers policies

* User controllers policies

* UserGroup controllers policies

* Other controllers cleanup

* Moved CreatePolicies to its own Extensions class

* Added TreeAccessScripts and TreeAccessStylesheets policies

* Remove comments

* Forgotten "New" prefix

* Duplicate Auth Policy

* Removed comment since we are using reference tokens and this is no longer a problem

* Fix AdminUserEditsRequireAdmin auth policy to use a constant

* Revert change

* Revery UpgradeControllerBase attribute

* Removed AdminUserEditsRequireAdmin policy as it will be implemented later on

* Adding RequireAdminAccess policy for Upgrade controller

* Wrong claim type
2023-07-19 08:02:51 +02:00
Bjarke Berg
7265d5c3be Use OpenIddict with real db instead of inmemory (#14465)
* Add OpenIddict tables to database (#14449)

* Added migrations to install EF Core OpenIddict tables

* Handle Install of ef core data (Needs to be outside of transaction

* Cleanup and renaming, as these things will be reused for more than openiddict in the future

* Cleanup

* Extract db context setup

* Minor cleanup

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>

* Use OpenIddict from DB instead of InMemoryDb

* Do not try to clean up, while not it run mode

* Fixed tests

* Clean up

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
Co-authored-by: Elitsa <elm@umbraco.dk>
2023-06-28 09:40:28 +03:00
Bjarke Berg
4180170acf Get current user endpoint in management api (#14336)
* Add current user data endpoint

* Add Change password endpoint

* Add SetAvatar

* Add get node permissions

* Add endpoint for getting currently logged in users linked logins

* Add tour service

* Add get tours

* Add set tour endpoint

* Added PermissionNames to IReadOnlyUserGroup

* Only require backend auth on management api

* Use ISet in response model

* Fixed issue with saving null as startMediaId, where it was ignored

* Add get current user endpoint

* Fix missing linebreak

* Append "New" keyword to policies

* Update OpenApi

---------

Co-authored-by: Nikolaj <nikolajlauridsen@protonmail.ch>
2023-06-05 15:20:18 +02:00
Bjarke Berg
b9c0e18fb1 Merge remote-tracking branch 'origin/v12/dev' into v14/dev
# Conflicts:
#	src/Umbraco.Cms.Api.Delivery/Services/ApiContentQueryService.cs
#	src/Umbraco.Core/CompatibilitySuppressions.xml
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryProvider.cs
#	src/Umbraco.Core/DeliveryApi/IApiContentQueryService.cs
#	src/Umbraco.Core/DeliveryApi/NoopApiContentQueryService.cs
2023-05-25 14:51:28 +02:00
Bjarke Berg
28712bd5cd Make new backoffice packable (#14286)
* This moves around files and deletes the temp projects with files that are not moved to Core, Infrastructure etc.

Also moves the from new backoffice to static access, and override those with the old views in the legacy executeable

* Removes old files from the new executeable.

* Added missing files

* Added EF Core project to solution file

* fix build
2023-05-25 10:38:44 +02:00
Bjarke Berg
0f1c2f7022 Ensure no management api for v12 (#14197)
* Remove management api

* Remove actual files
2023-05-04 13:32:41 +02:00
Kenn Jacobsen
7b62fb282f Dedicated cookie setup for new backoffice login (#14122)
* Add a dedicated (temporary) cookie setup for new backoffice logins, so old and new backoffice can co-exist behind separate logins

* use temp management api login endpoint for authentication

* Update OpenAPI JSON

---------

Co-authored-by: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com>
2023-04-19 13:32:11 +02:00
Bjarke Berg
bf4e745b6a Updated OpenIddict to v4 (#13830)
* Updated OpenIddict to v4 and when through the migration guide.

(SetAuthorizationEndpointUris and SetTokenEndpointUris should not start with a leading / anymore)

* Fixed issue where the old backoffice did not build

* Fixed build

* Fake a change - hopefully npm can see the file now?

* try using npm install instead of npm ci

* Another trial

* remove build of old backoffice

* Oops build new backoffice - not the old

* rollback changes to static assets

* Foreach csproj file instead. Fix for breaking change in dotnet sdk 7.0.200
2023-02-15 13:56:45 +01:00
Mole
73515560b7 New backoffice: Token storage (#13519)
* Enable reference tokens

* Enable token validation

* Add Data protection
2022-12-07 06:48:53 +01:00
Kenn Jacobsen
bc94b2e16c Rename management API from Umbraco.Cms.ManagementApi to Umbraco.Cms.Api.Management (#13512) 2022-12-02 11:33:02 +01:00