From e5c2743a061b2d608d514e74c9429fdf32c7da77 Mon Sep 17 00:00:00 2001 From: kjac Date: Mon, 11 Nov 2024 19:40:37 +0100 Subject: [PATCH 1/3] Add documentation for API Members --- 15/umbraco-cms/SUMMARY.md | 3 + .../README.md} | 6 +- .../images/api-member.png | Bin 0 -> 22983 bytes .../server-to-server-access.md | 197 ++++++++++++++++++ 4 files changed, 204 insertions(+), 2 deletions(-) rename 15/umbraco-cms/reference/content-delivery-api/{protected-content-in-the-delivery-api.md => protected-content-in-the-delivery-api/README.md} (98%) create mode 100644 15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/images/api-member.png create mode 100644 15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/server-to-server-access.md diff --git a/15/umbraco-cms/SUMMARY.md b/15/umbraco-cms/SUMMARY.md index 347d8f9a408..25f1391d8f4 100644 --- a/15/umbraco-cms/SUMMARY.md +++ b/15/umbraco-cms/SUMMARY.md @@ -99,6 +99,9 @@ * [Routing & Controllers](reference/routing/README.md) * [Routing in Umbraco](reference/routing/request-pipeline/README.md) * [IContentFinder](reference/routing/request-pipeline/icontentfinder.md) +* [Content Delivery API](reference/content-delivery-api/README.md) + * [Protected content in the Delivery API](reference/content-delivery-api/protected-content-in-the-delivery-api/README.md) + * [Server to server access](reference/content-delivery-api/protected-content-in-the-delivery-api/server-to-server-access.md) * [Common Pitfalls & Anti-Patterns](reference/common-pitfalls.md) * [UmbracoMapper](reference/mapping.md) * [Depencency Injection / IoC](reference/using-ioc.md) diff --git a/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api.md b/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/README.md similarity index 98% rename from 15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api.md rename to 15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/README.md index 2d43a32d95e..aa9f45782ca 100644 --- a/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api.md +++ b/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/README.md @@ -9,11 +9,13 @@ Umbraco allows for restricting access to content. Using the "Public access" feat By default, protected content is ignored by the Delivery API, and is never exposed through any API endpoints. However, by enabling member authorization in the Delivery API, protected content can be accessed by means of access tokens. {% hint style="info" %} -Member authorization in the Delivery API was introduced in version 12.3. +If you are not familiar with members in Umbraco, please read the [Members](https://docs.umbraco.com/umbraco-cms/fundamentals/data/members) article. {% endhint %} {% hint style="info" %} -If you are not familiar with members in Umbraco, please read the [Members](https://docs.umbraco.com/umbraco-cms/fundamentals/data/members) article. +This article describes how to access protected content in a client-to-server context, using an interactive authorization flow. + +If you are looking to achieve server-to-server access to protected content, please refer to [this article](server-to-server-access.md) instead. {% endhint %} ## Member authorization diff --git a/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/images/api-member.png b/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/images/api-member.png new file mode 100644 index 0000000000000000000000000000000000000000..62925be5ec625251767547f95c170089c0e51a49 GIT binary patch literal 22983 zcmeFZWmFwa@Hcpo;BawwcMI+i2oM4UcMtA*aS84o9D=($!975*;BawwciEdK|98Ld zzWZhO?3}})XL{~TbyanB^{=WX{ELD#DiR?Q002Ohm622i0AMNr04RC{ILH;ogP!IUnVz5a3R8;>(|&w6q*YG8cM$oJ@K3k?FQ98J>%Yc zM&_M@?{gl;$9OO#5YRFHJ1oaO9HL47JG8sIKmBW^_y7N`^chJ6iWw5?Kz?2l%c0Kz zmvj7mAP~wc|(5~^`3nf_TN#0JFA6k z-81e08;vM2nQCow;BoP$QN~7ibb37d&?Mi1iMA0{1glhOFp}D9 z>dpQV-RByonPWoGb7yP{EPQIguk|g-@LAk_k^E|A^l%-7zNwps|3-A{a((MUNC!4~3jg5NQyydYD32yFxT!X7T)zO?n3b@MOfC3Cr zp~u@SLt9GruFwp__)|EB-BvDiS}pNIfd}b&G~wJo$9%Xf`f8K82NaHy$=D5?)GNc4 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qz;In7ke= z>m3~I9z)rUb^qa>Dx#Z1cVr$12D++d8@v)m&Gb$FhoX`;V4rRXU}>XMII5i*W9H}G zGO}{5Y=cf4OvhBzOaF<=4abhYc@aK_jy1GV*IXScxyqrgrBxcTwHQpBix&-dVT)pz zg2h!;oMmNY4Uw&9#%l=egL!I9qpKc&ti9#vTBnc$g$rN)eTcwF02%V!Cc6=!JXJTL zP`{a`XL)LJa;O+I>W{|9l|S7#$!d|S9mn|i`QmucJKO$uR~e->j*g5!(c#fcGZr`N tD@OjypxtsFYxaNrpN~cS{}XtJkW8#$i)W6KDI>lNFuQ7LRBhlA^DiGSLdXCB literal 0 HcmV?d00001 diff --git a/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/server-to-server-access.md b/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/server-to-server-access.md new file mode 100644 index 00000000000..e9a8ad25bf6 --- /dev/null +++ b/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/server-to-server-access.md @@ -0,0 +1,197 @@ +--- +description: How to fetch protected content from the Delivery API with a server-to-server approach. +--- + +# Server-to-server access to protected content in the Delivery API + +If protected content is consumed from Delivery API in a server-to-server context, the [interactive authorization flow](README.md) won't work. Instead, we have to utilise the OpenId Connect Client Credentials flow, which is configured in the application settings. + +## Configuration + +In the Delivery API, Client Credentials work by mapping known Members to client IDs and secrets. These Members are known as API Members. When an API consumer uses the Client Credentials of an API Member, the consumer efficiently assumes the identity of this API Member. + +{% hint style="info" %} +An API Member works exactly the same as a regular Member, with the added option of authorizing with Client Credentials. +{% endhint %} + +In the following configuration example, the Member "member@local" are mapped to a set of Client Credentials: + +{% code title="appsettings.json" %} + +```json +{ + "Umbraco": { + "CMS": { + "DeliveryApi": { + "Enabled": true, + "MemberAuthorization": { + "ClientCredentialsFlow": { + "Enabled": true, + "AssociatedMembers": [ + { + "ClientId": "my-client", + "ClientSecret": "my-client-secret", + "UserName": "member@local" + } + ] + } + } + } + } + } +} +``` + +{% endcode %} + +After restarting the site, the backoffice will now list "member@local" as an API Member: + +![An API Member in the backoffice](images/api-member.png) + +## Authorizing and consuming the Delivery API + +The configured Client Credentials can be exchanged for an access token using the Delivery API token endpoint. Subsequently, the access token can be used as a Bearer token to retrieve protected content from the Delivery API. + +The following code sample illustrates how this can be done. + +{% hint style="info" %} +This sample requires the NuGet packages [`Microsoft.Extensions.Hosting`](https://www.nuget.org/packages/Microsoft.Extensions.Hosting) and [`IdentityModel`](https://www.nuget.org/packages/IdentityModel) to run. +{% endhint %} + +You should _always_ reuse access tokens for the duration of their lifetime. This will increase performance both for your Delivery API consumer and for the Delivery API itself. + +{% hint style="info" %} +The code sample handles token reuse in the `ApiAccessTokenService` service. It must be registered as a singleton service to work. +{% endhint %} + +In the code sample, the token endpoint is hardcoded in the token exchange request. The Delivery API also supports OpenId Connect Discovery for API Members, if you prefer that. + +{% code title="Program.cs" lineNumbers="true" %} +```csharp +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using System.Net.Http.Json; +using IdentityModel.Client; + +var builder = Host.CreateApplicationBuilder(args); +builder.Services.AddSingleton(); +builder.Services.AddTransient(); + +using IHost host = builder.Build(); +var consumer = host.Services.GetRequiredService(); +await consumer.ExecuteAsync(); + +public static class Constants +{ + // the base URL of the Umbraco site - change this to fit your own setup + public static string Host => "https://localhost:44391"; +} + +// this is the API consumer, which will be listing the first few available content items - including protected ones. +public class ApiConsumerService +{ + private readonly ApiAccessTokenService _apiAccessTokenService; + + public ApiConsumerService(ApiAccessTokenService apiAccessTokenService) + => _apiAccessTokenService = apiAccessTokenService; + + public async Task ExecuteAsync() + { + // get an access token from the access token service. + var accessToken = _apiAccessTokenService.GetAccessToken(); + if (accessToken is null) + { + Console.WriteLine("Could not get an access token, aborting."); + return; + } + + var client = new HttpClient(); + client.SetBearerToken(accessToken); + + // fetch [pageSize] content items from the "all content" Delivery API endpoint. + const int pageSize = 5; + var apiResponse = await client.GetAsync($"{Constants.Host}/umbraco/delivery/api/v2/content?take={pageSize}"); + var apiContentResponse = await apiResponse + .EnsureSuccessStatusCode() + .Content + .ReadFromJsonAsync(); + + if (apiContentResponse is null) + { + Console.WriteLine("Could not parse content from the API response."); + return; + } + + Console.WriteLine($"There are {apiContentResponse.Total} items in total - listing the first {pageSize} items."); + foreach (var item in apiContentResponse.Items) + { + Console.WriteLine($"- {item.Name} ({item.Id})"); + } + } +} + +// this service ensures reuse of access tokens for the duration of their lifetime. +// it must be registered as a singleton service to work properly. +public class ApiAccessTokenService +{ + private readonly Lock _lock = new(); + + private string? _accessToken; + private DateTime _accessTokenExpiry = DateTime.MinValue; + + public string? GetAccessToken() + { + if (_accessTokenExpiry > DateTime.UtcNow) + { + // we already have a token, reuse it. + return _accessToken; + } + + using (_lock.EnterScope()) + { + if (_accessTokenExpiry > DateTime.UtcNow) + { + // another thread fetched a new token before this thread entered the lock, reuse it. + return _accessToken; + } + + var client = new HttpClient(); + var tokenResponse = client.RequestClientCredentialsTokenAsync( + new ClientCredentialsTokenRequest + { + Address = $"{Constants.Host}/umbraco/delivery/api/v1/security/member/token", + ClientId = "umbraco-member-my-client", + ClientSecret = "my-client-secret" + } + ) + // cannot await inside a using. + .GetAwaiter().GetResult(); + + if (tokenResponse.IsError || tokenResponse.AccessToken is null) + { + Console.WriteLine($"Error obtaining a token: {tokenResponse.ErrorDescription}"); + return null; + } + + _accessToken = tokenResponse.AccessToken; + _accessTokenExpiry = DateTime.UtcNow.AddSeconds(tokenResponse.ExpiresIn - 20); + return tokenResponse.AccessToken; + } + } +} + +public class ApiContentResponse +{ + public required int Total { get; set; } + + public required ApiContentItemResponse[] Items { get; set; } +} + +public class ApiContentItemResponse +{ + public required Guid Id { get; set; } + + public required string Name { get; set; } +} +``` +{% endcode %} From 1fa6d495cf5a1fc0e87c9112baa101925f2e29e7 Mon Sep 17 00:00:00 2001 From: sofietoft Date: Tue, 12 Nov 2024 11:31:25 +0100 Subject: [PATCH 2/3] Minor grammar fixes --- .../server-to-server-access.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/server-to-server-access.md b/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/server-to-server-access.md index e9a8ad25bf6..8c042c41ded 100644 --- a/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/server-to-server-access.md +++ b/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/server-to-server-access.md @@ -4,17 +4,17 @@ description: How to fetch protected content from the Delivery API with a server- # Server-to-server access to protected content in the Delivery API -If protected content is consumed from Delivery API in a server-to-server context, the [interactive authorization flow](README.md) won't work. Instead, we have to utilise the OpenId Connect Client Credentials flow, which is configured in the application settings. +If protected content is consumed from the Delivery API in a server-to-server context, the [interactive authorization flow](README.md) won't work. Instead, we have to utilize the OpenId Connect Client Credentials flow, which is configured in the application settings. ## Configuration -In the Delivery API, Client Credentials work by mapping known Members to client IDs and secrets. These Members are known as API Members. When an API consumer uses the Client Credentials of an API Member, the consumer efficiently assumes the identity of this API Member. +In the Delivery API, Client Credentials map known Members to client IDs and secrets. These Members are known as API Members. When an API consumer uses the Client Credentials of an API Member, the consumer efficiently assumes the identity of this API Member. {% hint style="info" %} -An API Member works exactly the same as a regular Member, with the added option of authorizing with Client Credentials. +An API Member works the same as a regular Member, with the added option of authorizing with Client Credentials. {% endhint %} -In the following configuration example, the Member "member@local" are mapped to a set of Client Credentials: +In the following configuration example, the Member "member@local" is mapped to a set of Client Credentials: {% code title="appsettings.json" %} @@ -44,7 +44,7 @@ In the following configuration example, the Member "member@local" are mapped to {% endcode %} -After restarting the site, the backoffice will now list "member@local" as an API Member: +After restarting the site, the backoffice will list "member@local" as an API Member: ![An API Member in the backoffice](images/api-member.png) @@ -83,11 +83,11 @@ await consumer.ExecuteAsync(); public static class Constants { - // the base URL of the Umbraco site - change this to fit your own setup + // the base URL of the Umbraco site - change this to fit your custom setup public static string Host => "https://localhost:44391"; } -// this is the API consumer, which will be listing the first few available content items - including protected ones. +// This is the API consumer, which will be listing the first few available content items - including protected ones. public class ApiConsumerService { private readonly ApiAccessTokenService _apiAccessTokenService; @@ -130,8 +130,8 @@ public class ApiConsumerService } } -// this service ensures reuse of access tokens for the duration of their lifetime. -// it must be registered as a singleton service to work properly. +// This service ensures the reuse of access tokens for the duration of their lifetime. +// It must be registered as a singleton service to work properly. public class ApiAccessTokenService { private readonly Lock _lock = new(); From fdc2f2f0ffce6774534eec8b1360c364d92f003f Mon Sep 17 00:00:00 2001 From: Kenn Jacobsen Date: Tue, 12 Nov 2024 12:34:24 +0100 Subject: [PATCH 3/3] Update 15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/README.md Co-authored-by: sofietoft --- .../protected-content-in-the-delivery-api/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/README.md b/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/README.md index aa9f45782ca..50daecbd608 100644 --- a/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/README.md +++ b/15/umbraco-cms/reference/content-delivery-api/protected-content-in-the-delivery-api/README.md @@ -15,7 +15,7 @@ If you are not familiar with members in Umbraco, please read the [Members](https {% hint style="info" %} This article describes how to access protected content in a client-to-server context, using an interactive authorization flow. -If you are looking to achieve server-to-server access to protected content, please refer to [this article](server-to-server-access.md) instead. +If you are looking to achieve server-to-server access to protected content, please refer to [server-to-server access article](server-to-server-access.md) instead. {% endhint %} ## Member authorization