From 27eeafed996fef33380387d090629f0be7cb4a49 Mon Sep 17 00:00:00 2001 From: OpenIddict Bot <32257313+openiddict-bot@users.noreply.github.com> Date: Mon, 12 Feb 2018 00:01:56 +0000 Subject: [PATCH] Update the documentation pages --- features/application-permissions.html | 276 ++++++++++++++++++++++++++ features/index.html | 119 +++++++++++ features/toc.html | 119 +++++++++++ guide/migration.html | 81 +------- manifest.json | 58 +++++- toc.html | 3 + 6 files changed, 569 insertions(+), 87 deletions(-) create mode 100644 features/application-permissions.html create mode 100644 features/index.html create mode 100644 features/toc.html diff --git a/features/application-permissions.html b/features/application-permissions.html new file mode 100644 index 0000000..9de3b2b --- /dev/null +++ b/features/application-permissions.html @@ -0,0 +1,276 @@ + + + + + + + + Application permissions + + + + + + + + + + + + + + + +
+
+ + + + +
+ + + +
+ + + + + + diff --git a/features/index.html b/features/index.html new file mode 100644 index 0000000..ff2dca9 --- /dev/null +++ b/features/index.html @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ + + +
+ + + + + + diff --git a/features/toc.html b/features/toc.html new file mode 100644 index 0000000..c1dd727 --- /dev/null +++ b/features/toc.html @@ -0,0 +1,119 @@ + + + + + + + + Table of Content + + + + + + + + + + + + + + + +
+
+ + + + +
+ + + +
+ + + + + + diff --git a/guide/migration.html b/guide/migration.html index 5f18667..0b1e0ff 100644 --- a/guide/migration.html +++ b/guide/migration.html @@ -141,28 +141,6 @@ application.RedirectUris = new JArray(addresses).ToString(Formatting.None); } - - // Grant the application all the permissions. Don't hesitate to update - // the list to only grant the permissions really needed by the application. - if (string.IsNullOrEmpty(application.Permissions)) - { - var permissions = new[] - { - OpenIddictConstants.Permissions.Endpoints.Authorization, - OpenIddictConstants.Permissions.Endpoints.Introspection, - OpenIddictConstants.Permissions.Endpoints.Logout, - OpenIddictConstants.Permissions.Endpoints.Revocation, - OpenIddictConstants.Permissions.Endpoints.Token, - - OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode, - OpenIddictConstants.Permissions.GrantTypes.ClientCredentials, - OpenIddictConstants.Permissions.GrantTypes.Implicit, - OpenIddictConstants.Permissions.GrantTypes.Password, - OpenIddictConstants.Permissions.GrantTypes.RefreshToken - }; - - application.Permissions = new JArray(permissions).ToString(Formatting.None); - } } // If you use a different entity type or a custom key, @@ -199,60 +177,11 @@ UpdateOpenIddictTablesAsync(app.ApplicationServices).GetAwaiter().GetResult(); }

Run your application. Once it's correctly started, stop it and remove the migration script.

-

If necessary, update your code to grant applications the required permissions

-

If you have code that relies on OpenIddictApplicationManager.CreateAsync(OpenIddictApplicationDescriptor), -make sure that the appropriate set of permissions is granted.

-

For instance, to allow a client application to use the password and refresh token flows, you must grant the following permissions:

-
var descriptor = new OpenIddictApplicationDescriptor
-{
-    // ...
-    Permissions =
-    {
-        OpenIddictConstants.Permissions.Endpoints.Token,
-        OpenIddictConstants.Permissions.GrantTypes.Password,
-        OpenIddictConstants.Permissions.GrantTypes.RefreshToken
-    }
-};
-
-await manager.CreateAsync(descriptor);
-

For the authorization code flow, the following permissions are required:

-
var descriptor = new OpenIddictApplicationDescriptor
-{
-    // ...
-    Permissions =
-    {
-        OpenIddictConstants.Permissions.Endpoints.Authorization,
-        OpenIddictConstants.Permissions.Endpoints.Token,
-        OpenIddictConstants.Permissions.GrantTypes.AuthorizationCode
-    }
-};
-
-await manager.CreateAsync(descriptor);
-

For custom flows, use the OpenIddictConstants.Permissions.Prefixes.GrantType constant:

-
var descriptor = new OpenIddictApplicationDescriptor
-{
-    // ...
-    Permissions =
-    {
-        OpenIddictConstants.Permissions.Endpoints.Token,
-        OpenIddictConstants.Permissions.Prefixes.GrantType + "google_token_exchange"
-    }
-};
-
-await manager.CreateAsync(descriptor);
-

If your application uses introspection or revocation, these endpoints must also be enable. E.g:

-
var descriptor = new OpenIddictApplicationDescriptor
-{
-    // ...
-    Permissions =
-    {
-        OpenIddictConstants.Permissions.Endpoints.Introspection,
-        OpenIddictConstants.Permissions.Endpoints.Revocation
-    }
-};
-
-await manager.CreateAsync(descriptor);
-

List of changes (for applications using custom stores)

+

Optionally, update your code to grant applications the minimum required permissions

+

Starting with RC2, OpenIddict includes an optional feature codenamed "app permissions" that allows +controlling and limiting the OAuth2/OpenID Connect features a client application is able to use.

+

To learn more about this feature, read the Application permissions documentation.

+

List of changes (for applications using custom stores)

Renamed properties

diff --git a/manifest.json b/manifest.json index 953939e..c4689c7 100644 --- a/manifest.json +++ b/manifest.json @@ -74,6 +74,42 @@ "is_incremental": false, "version": "" }, + { + "type": "Conceptual", + "source_relative_path": "features/application-permissions.md", + "output": { + ".html": { + "relative_path": "features/application-permissions.html", + "hash": "Q9YeZDb5Xi2qYUPZCIV2Fg==" + } + }, + "is_incremental": false, + "version": "" + }, + { + "type": "Conceptual", + "source_relative_path": "features/index.md", + "output": { + ".html": { + "relative_path": "features/index.html", + "hash": "XqKWaZORYS552qmlWgIl8A==" + } + }, + "is_incremental": false, + "version": "" + }, + { + "type": "Toc", + "source_relative_path": "features/toc.yml", + "output": { + ".html": { + "relative_path": "features/toc.html", + "hash": "mh8ipy1SiRiL3xGmh8dI9w==" + } + }, + "is_incremental": false, + "version": "" + }, { "type": "Conceptual", "source_relative_path": "guide/getting-started.md", @@ -104,7 +140,7 @@ "output": { ".html": { "relative_path": "guide/migration.html", - "hash": "LslsCYsgYfBwjVuKYi3brg==" + "hash": "LpaDiniOjh3+v0brkllWeQ==" } }, "is_incremental": false, @@ -152,7 +188,7 @@ "output": { ".html": { "relative_path": "toc.html", - "hash": "DXK29jBdtRMjNtYqHIIxxg==" + "hash": "AIuWUZ3w7ANfT7rrvxU/jA==" } }, "is_incremental": false, @@ -167,15 +203,6 @@ "incrementalPhase": "build" }, "processors": { - "ResourceDocumentProcessor": { - "can_incremental": false, - "details": "Processor ResourceDocumentProcessor cannot suppport incremental build because the processor doesn't implement ISupportIncrementalDocumentProcessor interface.", - "incrementalPhase": "build" - }, - "ConceptualDocumentProcessor": { - "can_incremental": false, - "incrementalPhase": "build" - }, "RestApiDocumentProcessor": { "can_incremental": false, "details": "Processor RestApiDocumentProcessor cannot suppport incremental build because the processor doesn't implement ISupportIncrementalDocumentProcessor interface.", @@ -186,6 +213,15 @@ "details": "Processor TocDocumentProcessor cannot suppport incremental build because the processor doesn't implement ISupportIncrementalDocumentProcessor interface.", "incrementalPhase": "build" }, + "ConceptualDocumentProcessor": { + "can_incremental": false, + "incrementalPhase": "build" + }, + "ResourceDocumentProcessor": { + "can_incremental": false, + "details": "Processor ResourceDocumentProcessor cannot suppport incremental build because the processor doesn't implement ISupportIncrementalDocumentProcessor interface.", + "incrementalPhase": "build" + }, "ManagedReferenceDocumentProcessor": { "can_incremental": false, "incrementalPhase": "build" diff --git a/toc.html b/toc.html index 41f4dac..bf93405 100644 --- a/toc.html +++ b/toc.html @@ -78,6 +78,9 @@
  • Migration guide
  • +
  • + Features +