From 50fd5de8667d793cfdf27ea75189762f98b7d685 Mon Sep 17 00:00:00 2001 From: OpenIddict Bot <32257313+openiddict-bot@users.noreply.github.com> Date: Wed, 13 Jan 2021 05:01:54 +0000 Subject: [PATCH] Update the documentation pages --- guide/getting-started.html | 18 +++++++++++------- manifest.json | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/guide/getting-started.html b/guide/getting-started.html index 154ac58..5b7117c 100644 --- a/guide/getting-started.html +++ b/guide/getting-started.html @@ -210,16 +210,16 @@ Here's an example for the client credentials grant:

var request = HttpContext.GetOpenIddictServerRequest(); if (!request.IsClientCredentialsGrantType()) { - throw new NotImplementedException("The specified grant type is not implemented."); + throw new NotImplementedException("The specified grant is not implemented."); } // Note: the client credentials are automatically validated by OpenIddict: // if client_id or client_secret are invalid, this action won't be invoked. var application = await _applicationManager.FindByClientIdAsync(request.ClientId); - if (application == null) + if (application is null) { - throw new InvalidOperationException("The application details cannot be found in the database."); + throw new InvalidOperationException("The application details cannot be found."); } // Create a new ClaimsIdentity containing the claims that @@ -229,13 +229,16 @@ Here's an example for the client credentials grant:

Claims.Name, Claims.Role); // Use the client_id as the subject identifier. - identity.AddClaim(Claims.Subject, await _applicationManager.GetClientIdAsync(application), + identity.AddClaim(Claims.Subject, + await _applicationManager.GetClientIdAsync(application), Destinations.AccessToken, Destinations.IdentityToken); - identity.AddClaim(Claims.Name, await _applicationManager.GetDisplayNameAsync(application), + identity.AddClaim(Claims.Name, + await _applicationManager.GetDisplayNameAsync(application), Destinations.AccessToken, Destinations.IdentityToken); - return SignIn(new ClaimsPrincipal(identity), OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); + return SignIn(new ClaimsPrincipal(identity), + OpenIddictServerAspNetCoreDefaults.AuthenticationScheme); } } @@ -254,7 +257,8 @@ Here's an example for the client credentials grant:

var context = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>(); await context.Database.EnsureCreatedAsync(); - var manager = scope.ServiceProvider.GetRequiredService<IOpenIddictApplicationManager>(); + var manager = + scope.ServiceProvider.GetRequiredService<IOpenIddictApplicationManager>(); if (await manager.FindByClientIdAsync("console") is null) { diff --git a/manifest.json b/manifest.json index 346796e..7e26c7a 100644 --- a/manifest.json +++ b/manifest.json @@ -45,7 +45,7 @@ "output": { ".html": { "relative_path": "guide/getting-started.html", - "hash": "G5Z0qYgQEEbzw1G+VpiRHg==" + "hash": "x2y3JmMShZP8OKbVIkktGw==" } }, "is_incremental": false,