From 928c228ad8eb1fddc92c58b68e3d6f6310dd2e30 Mon Sep 17 00:00:00 2001 From: OpenIddict Bot <32257313+openiddict-bot@users.noreply.github.com> Date: Mon, 25 Jan 2021 17:47:01 +0000 Subject: [PATCH] Update the documentation pages --- configuration/authorization-storage.html | 16 ++++++++++------ manifest.json | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/configuration/authorization-storage.html b/configuration/authorization-storage.html index 8a70b2d..ff2bd00 100644 --- a/configuration/authorization-storage.html +++ b/configuration/authorization-storage.html @@ -79,9 +79,9 @@ and explicitly attached to a ClaimsPrincipal using the OpenIddict-s For that, a "consent type" can be defined per-application, as in the following example:

// Retrieve the application details from the database.
 var application = await _applicationManager.FindByClientIdAsync(request.ClientId) ??
-    throw new InvalidOperationException("Details concerning the calling client application cannot be found.");
+    throw new InvalidOperationException("The application cannot be found.");
 
-// Retrieve the permanent authorizations associated with the user and the calling client application.
+// Retrieve the permanent authorizations associated with the user and the application.
 var authorizations = await _authorizationManager.FindAsync(
     subject: await _userManager.GetUserIdAsync(user),
     client : await _applicationManager.GetIdAsync(application),
@@ -98,7 +98,8 @@ switch (await _applicationManager.GetConsentTypeAsync(application))
             authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme,
             properties: new AuthenticationProperties(new Dictionary<string, string>
             {
-                [OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.ConsentRequired,
+                [OpenIddictServerAspNetCoreConstants.Properties.Error] =
+                    Errors.ConsentRequired,
                 [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] =
                     "The logged in user is not allowed to access this client application."
             }));
@@ -107,14 +108,16 @@ switch (await _applicationManager.GetConsentTypeAsync(application))
     // return an authorization response without displaying the consent form.
     case ConsentTypes.Implicit:
     case ConsentTypes.External when authorizations.Any():
-    case ConsentTypes.Explicit when authorizations.Any() && !request.HasPrompt(Prompts.Consent):
+    case ConsentTypes.Explicit when authorizations.Any() &&
+        !request.HasPrompt(Prompts.Consent):
         var principal = await _signInManager.CreateUserPrincipalAsync(user);
 
         // Note: in this sample, the granted scopes match the requested scope
         // but you may want to allow the user to uncheck specific scopes.
         // For that, simply restrict the list of scopes before calling SetScopes.
         principal.SetScopes(request.GetScopes());
-        principal.SetResources(await _scopeManager.ListResourcesAsync(principal.GetScopes()).ToListAsync());
+        principal.SetResources(await _scopeManager.ListResourcesAsync(
+            principal.GetScopes()).ToListAsync());
 
         // Automatically create a permanent authorization to avoid requiring explicit consent
         // for future authorization or token requests containing the same scopes.
@@ -146,7 +149,8 @@ switch (await _applicationManager.GetConsentTypeAsync(application))
             authenticationSchemes: OpenIddictServerAspNetCoreDefaults.AuthenticationScheme,
             properties: new AuthenticationProperties(new Dictionary<string, string>
             {
-                [OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.ConsentRequired,
+                [OpenIddictServerAspNetCoreConstants.Properties.Error] =
+                    Errors.ConsentRequired,
                 [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] =
                     "Interactive user consent is required."
             }));
diff --git a/manifest.json b/manifest.json
index f3cd374..629bdea 100644
--- a/manifest.json
+++ b/manifest.json
@@ -9861,7 +9861,7 @@
       "output": {
         ".html": {
           "relative_path": "configuration/authorization-storage.html",
-          "hash": "u/HsIJFZPle5GhsRMjBbeA=="
+          "hash": "OFSAAR/675OwAhhWVsS24w=="
         }
       },
       "is_incremental": false,