diff --git a/src/content/docs/accesstokenmanagement/advanced/user-tokens.md b/src/content/docs/accesstokenmanagement/advanced/user-tokens.md index 0edca312..53ba4220 100644 --- a/src/content/docs/accesstokenmanagement/advanced/user-tokens.md +++ b/src/content/docs/accesstokenmanagement/advanced/user-tokens.md @@ -57,14 +57,19 @@ The `UserTokenRequestParameters` class can be used for that: The request parameters can be passed via the manual API: ```csharp -var token = await _tokenManagementService.GetAccessTokenAsync(User, new UserAccessTokenRequestParameters { ... }); +var token = await _tokenManagementService + .GetAccessTokenAsync(User, new UserAccessTokenRequestParameters { + // ... + }); ``` ...the extension methods ```csharp var token = await HttpContext.GetUserAccessTokenAsync( - new UserTokenRequestParameters { ... }); + new UserTokenRequestParameters { + // ... + }); ``` ...or the HTTP client factory @@ -73,7 +78,9 @@ var token = await HttpContext.GetUserAccessTokenAsync( // Program.cs // registers HTTP client that uses the managed user access token builder.Services.AddUserAccessTokenHttpClient("invoices", - parameters: new UserTokenRequestParameters { ... }, + parameters: new UserTokenRequestParameters { + // ... + }, configureClient: client => { client.BaseAddress = new Uri("https://api.company.com/invoices/"); @@ -84,7 +91,9 @@ builder.Services.AddHttpClient(client => { client.BaseAddress = new Uri("https://api.company.com/invoices/"); }) - .AddUserAccessTokenHandler(new UserTokenRequestParameters { ... }); + .AddUserAccessTokenHandler(new UserTokenRequestParameters { + // ... + }); ``` ## Token Storage diff --git a/src/content/docs/bff/extensibility/tokens.md b/src/content/docs/bff/extensibility/tokens.md index 7c52e93d..575e2401 100644 --- a/src/content/docs/bff/extensibility/tokens.md +++ b/src/content/docs/bff/extensibility/tokens.md @@ -26,8 +26,9 @@ The token management library uses a named HTTP client from the HTTP client facto ```cs builder.Services.AddHttpClient( AccessTokenManagementDefaults.BackChannelHttpClientName, - configureClient => { ... } - ); + configureClient => { + // ... + }); ``` :::note diff --git a/src/content/docs/bff/fundamentals/apis/local.md b/src/content/docs/bff/fundamentals/apis/local.md index cd1f596a..7a741843 100644 --- a/src/content/docs/bff/fundamentals/apis/local.md +++ b/src/content/docs/bff/fundamentals/apis/local.md @@ -106,12 +106,13 @@ Endpoints that require the pre- and post-processing described above must be deco For Minimal API endpoints, you can apply BFF pre- and post-processing when they are mapped. ```csharp -app.MapPost("/foo", context => { ... }) +app.MapPost("/foo", context => { + // ... + }) .RequireAuthorization() // no anonymous access .AsBffApiEndpoint(); // BFF pre/post processing ``` - For MVC controllers, you can similarly apply BFF pre- and post-processing to controller actions when they are mapped. ```csharp app.MapControllers() @@ -124,7 +125,9 @@ Alternatively, you can apply the *[BffApi]* attribute directly to the controller [Route("myApi")] [BffApi] public class MyApiController : ControllerBase -{ ... } +{ + // ... +} ``` #### Disabling Anti-forgery Protection @@ -144,7 +147,9 @@ app.MapControllers() .AsBffApiEndpoint(requireAntiforgeryCheck: false); // simple endpoint -app.MapPost("/foo", context => { /* ... */ }) +app.MapPost("/foo", context => { + // ... + }) .RequireAuthorization() // WARNING: Disabling antiforgery protection may make // your APIs vulnerable to CSRF attacks diff --git a/src/content/docs/bff/fundamentals/session/handlers.md b/src/content/docs/bff/fundamentals/session/handlers.md index 466647d0..b69e4682 100644 --- a/src/content/docs/bff/fundamentals/session/handlers.md +++ b/src/content/docs/bff/fundamentals/session/handlers.md @@ -28,8 +28,12 @@ builder.Services.AddAuthentication(options => options.DefaultChallengeScheme = "oidc"; options.DefaultSignOutScheme = "oidc"; }) - .AddCookie("cookie", options => { ... }) - .AddOpenIdConnect("oidc", options => { ... }); + .AddCookie("cookie", options => { + // ... + }) + .AddOpenIdConnect("oidc", options => { + // ... + }); ``` ## The OpenID Connect Authentication Handler diff --git a/src/content/docs/identityserver/data/ef.md b/src/content/docs/identityserver/data/ef.md index 046beb9d..cefd3097 100644 --- a/src/content/docs/identityserver/data/ef.md +++ b/src/content/docs/identityserver/data/ef.md @@ -78,7 +78,9 @@ To enable caching for the EF configuration store implementation, use the `AddCon ```csharp // Program.cs builder.Services.AddIdentityServer() - .AddConfigurationStore(options => { ... }) + .AddConfigurationStore(options => { + // ... + }) // this is something you will want in production to reduce load on and requests to the DB .AddConfigurationStoreCache(); ``` diff --git a/src/content/docs/identityserver/fundamentals/hosting.md b/src/content/docs/identityserver/fundamentals/hosting.md index d4da78aa..e4d6ce7b 100644 --- a/src/content/docs/identityserver/fundamentals/hosting.md +++ b/src/content/docs/identityserver/fundamentals/hosting.md @@ -23,11 +23,14 @@ You add the necessary services to the ASP.NET Core service provider by calling ` ```cs //Program.cs -var idsvrBuilder = builder.Services.AddIdentityServer(options => { ... }); +var idsvrBuilder = builder.Services.AddIdentityServer(options => +{ + // ... +}); ``` Many of the fundamental configuration settings can be set on the options. See the -`[IdentityServerOptions](/identityserver/reference/options)` reference for more details. +[`IdentityServerOptions`](/identityserver/reference/options) reference for more details. The builder object has a number of extension methods to add additional services to the ASP.NET Core service provider. You can see the full list in the [reference](/identityserver/reference/di) section, but very commonly you start by