Update the documentation pages

This commit is contained in:
OpenIddict Bot 2021-01-13 05:30:23 +00:00
parent eb07532662
commit f52e469d33
2 changed files with 38 additions and 22 deletions

View File

@ -5,9 +5,9 @@
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Migrate to OpenIddict RC3 </title>
<title>Migrate to OpenIddict 1.0/2.0 </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Migrate to OpenIddict RC3 ">
<meta name="title" content="Migrate to OpenIddict 1.0/2.0 ">
<meta name="generator" content="docfx 2.56.6.0">
<link rel="shortcut icon" href="../images/favicon.ico">
@ -66,18 +66,34 @@
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="">
<h1 id="migrate-to-openiddict-rc3">Migrate to OpenIddict RC3</h1>
<h1 id="migrate-to-openiddict-1020">Migrate to OpenIddict 1.0/2.0</h1>
<h2 id="whats-new-in-openiddict-rc3">What&#39;s new in OpenIddict RC3?</h2>
<p>The announcement listing the changes introduced in this milestone can be found <a href="https://kevinchalet.com/2018/06/20/openiddict-rc3-is-out/">here</a>.</p>
<h2 id="whats-new-in-openiddict-1020">What&#39;s new in OpenIddict 1.0/2.0?</h2>
<p>The announcement listing the changes introduced in this milestone can be found <a href="https://kevinchalet.com/2018/11/01/openiddict-1-0-and-2-0-general-availability/">here</a>.</p>
<h2 id="update-your-packages-references">Update your packages references</h2>
<p>For that, simply update your <code>.csproj</code> file to point to the newest OpenIddict packages:</p>
<h3 id="aspnet-core-1x">ASP.NET Core 1.x</h3>
<pre><code class="lang-xml">&lt;ItemGroup&gt;
&lt;PackageReference Include=&quot;OpenIddict&quot; Version=&quot;1.0.0&quot; /&gt;
&lt;PackageReference Include=&quot;OpenIddict.EntityFrameworkCore&quot; Version=&quot;1.0.0&quot; /&gt;
&lt;/ItemGroup&gt;
</code></pre><h3 id="aspnet-core-2x">ASP.NET Core 2.x</h3>
<pre><code class="lang-xml">&lt;ItemGroup&gt;
&lt;PackageReference Include=&quot;OpenIddict&quot; Version=&quot;2.0.0&quot; /&gt;
&lt;PackageReference Include=&quot;OpenIddict.EntityFrameworkCore&quot; Version=&quot;2.0.0&quot; /&gt;
&lt;/ItemGroup&gt;
</code></pre><p>No additional change should be required for basic scenarios.</p>
<h1 id="migrate-to-openiddict-1020-rc3">Migrate to OpenIddict 1.0/2.0 rc3</h1>
<h2 id="whats-new-in-openiddict-1020-rc3">What&#39;s new in OpenIddict 1.0/2.0 rc3?</h2>
<p>The announcement listing the changes introduced in this milestone can be found <a href="https://kevinchalet.com/2018/06/20/openiddict-rc3-is-out/">here</a>.</p>
<h2 id="update-your-packages-references-1">Update your packages references</h2>
<p>For that, simply update your <code>.csproj</code> file to point to the newest OpenIddict packages:</p>
<h3 id="aspnet-core-1x-1">ASP.NET Core 1.x</h3>
<pre><code class="lang-xml">&lt;ItemGroup&gt;
&lt;PackageReference Include=&quot;OpenIddict&quot; Version=&quot;1.0.0-rc3-final&quot; /&gt;
&lt;PackageReference Include=&quot;OpenIddict.EntityFrameworkCore&quot; Version=&quot;1.0.0-rc3-final&quot; /&gt;
&lt;/ItemGroup&gt;
</code></pre><h3 id="aspnet-core-2x">ASP.NET Core 2.x</h3>
</code></pre><h3 id="aspnet-core-2x-1">ASP.NET Core 2.x</h3>
<pre><code class="lang-xml">&lt;ItemGroup&gt;
&lt;PackageReference Include=&quot;OpenIddict&quot; Version=&quot;2.0.0-rc3-final&quot; /&gt;
&lt;PackageReference Include=&quot;OpenIddict.EntityFrameworkCore&quot; Version=&quot;2.0.0-rc3-final&quot; /&gt;
@ -85,11 +101,11 @@
</code></pre><div class="TIP"><h5>Tip</h5><p>Note: if you have an explicit reference to <code>AspNet.Security.OAuth.Validation</code> or <code>OpenIddict.Mvc</code>,
you can safely remove these dependencies: they are now transitively referenced by the <code>OpenIddict</code> metapackage.</p>
</div>
<div class="IMPORTANT"><h5>Important</h5><p>Note: if your application references <code>OpenIddict.Models</code> or <code>OpenIddict.Stores</code>, you MUST remove them as these packages are no longer used in RC3.</p>
<div class="IMPORTANT"><h5>Important</h5><p>Note: if your application references <code>OpenIddict.Models</code> or <code>OpenIddict.Stores</code>, you MUST remove them as these packages are no longer used in rc3.</p>
</div>
<h2 id="use-the-new-openiddict-services-registration-apis">Use the new OpenIddict services registration APIs</h2>
<p>To offer a better user experience, the registrations APIs exposed by OpenIddict have been reworked. Updating your code should be quite straightforward:</p>
<pre><code class="lang-csharp">// In OpenIddict RC2, all the options used to be grouped.
<pre><code class="lang-csharp">// In OpenIddict rc2, all the options used to be grouped.
services.AddOpenIddict(options =&gt;
{
options.AddEntityFrameworkCoreStores&lt;ApplicationDbContext&gt;();
@ -117,7 +133,7 @@ services.AddOpenIddict(options =&gt;
options.DisableHttpsRequirement();
});
</code></pre><pre><code class="lang-csharp">// In OpenIddict RC3, the options are now split into 3 categories:
</code></pre><pre><code class="lang-csharp">// In OpenIddict rc3, the options are now split into 3 categories:
// the core services, the server services and the validation services.
services.AddOpenIddict()
.AddCore(options =&gt;
@ -173,7 +189,7 @@ You don&#39;t have to explicitly add a new <code>PackageReference</code> in your
</div>
<h2 id="if-necessary-create-new-application-entries">If necessary, create new application entries</h2>
<p>OpenIddict now rejects unauthenticated token/revocation requests by default.</p>
<p>If, after migrating to RC3, you see errors similar to this one:</p>
<p>If, after migrating to rc3, you see errors similar to this one:</p>
<blockquote><p><strong>invalid_request</strong> : The mandatory &#39;client_id&#39; parameter is missing.</p>
</blockquote>
<p>Add an application entry for the client application and send the corresponding <code>client_id</code> as part of the token request:</p>
@ -200,8 +216,8 @@ await _applicationManager.CreateAsync(descriptor);
options.AcceptAnonymousClients();
});
</code></pre><h2 id="if-necessary-register-the-scopes-used-by-your-clients">If necessary, register the scopes used by your clients</h2>
<p>Starting with RC3, OpenIddict will reject unrecognized scopes by default.</p>
<p>If, after migrating to RC3, you see errors similar to this one:</p>
<p>Starting with rc3, OpenIddict will reject unrecognized scopes by default.</p>
<p>If, after migrating to rc3, you see errors similar to this one:</p>
<blockquote><p><strong>invalid_scope</strong> : The specified &#39;scope&#39; parameter is not valid.</p>
</blockquote>
<p>Simply add the scopes you want to use to the list of registered scopes:</p>
@ -221,7 +237,7 @@ await _applicationManager.CreateAsync(descriptor);
options.DisableScopeValidation();
});
</code></pre><h2 id="if-necessary-adjust-the-permissions-granted-to-your-clients">If necessary, adjust the permissions granted to your clients</h2>
<p><strong>Starting with RC3, permissions are no longer optional nor implicit</strong>:
<p><strong>Starting with rc3, permissions are no longer optional nor implicit</strong>:
if you don&#39;t explicitly grant an application the necessary permissions, it will be blocked by OpenIddict.</p>
<p>To attach permissions to an application, use <code>OpenIddictApplicationManager</code>:</p>
<pre><code class="lang-csharp">var descriptor = new OpenIddictApplicationDescriptor
@ -256,18 +272,18 @@ await _applicationManager.CreateAsync(descriptor);
.IgnoreScopePermissions();
});
</code></pre><hr>
<h1 id="migrate-to-openiddict-rc2">Migrate to OpenIddict RC2</h1>
<h2 id="whats-new-in-openiddict-rc2">What&#39;s new in OpenIddict RC2?</h2>
<h1 id="migrate-to-openiddict-rc2">Migrate to OpenIddict rc2</h1>
<h2 id="whats-new-in-openiddict-rc2">What&#39;s new in OpenIddict rc2?</h2>
<p>The full list of changes can be found <a href="https://github.com/openiddict/openiddict-core/milestone/8?closed=1">here</a>. It includes <strong>bug fixes</strong> (including a bug fix in the refresh token handling)
and new features like <strong>application permissions</strong>, that allow limiting the OpenID Connect features (endpoints and flows) an application is able to use.</p>
<p><strong>Migrating to OpenIddict RC2 (<code>1.0.0-rc2-final</code> and <code>2.0.0-rc2-final</code>) requires making changes in your database</strong>: existing properties have been reworked
<p><strong>Migrating to OpenIddict rc2 (<code>1.0.0-rc2-final</code> and <code>2.0.0-rc2-final</code>) requires making changes in your database</strong>: existing properties have been reworked
(e.g <a href="https://github.com/openiddict/openiddict-core/issues/497">to work around a MySQL limitation</a>) and new ones have been added to support the new features.
This procedure is quite easy and only requires a few minutes.</p>
<blockquote><p>Note: this guide assumes your application uses the OpenIddict Entity Framework Core 2.x stores. If you use a custom store, changes will have to be made manually.
A list of added/updated/renamed columns is available at the end of this guide.</p>
</blockquote>
<h2 id="ensure-migrations-are-correctly-enabled-for-your-project">Ensure migrations are correctly enabled for your project</h2>
<p><strong>Before migrating to OpenIddict RC2, make sure migrations are already enabled for your application</strong>. If you have a <code>Migrations</code>
<p><strong>Before migrating to OpenIddict rc2, make sure migrations are already enabled for your application</strong>. If you have a <code>Migrations</code>
folder in your application root folder and an <code>__EFMigrationsHistory</code> table in your database, you&#39;re good to go.</p>
<p>If you don&#39;t have these Entity Framework Core artifacts, migrations are likely not enabled. To fix that, add the following entries in your <code>.csproj</code>:</p>
<pre><code class="lang-xml">&lt;ItemGroup&gt;
@ -280,15 +296,15 @@ folder in your application root folder and an <code>__EFMigrationsHistory</code>
Version=&quot;2.0.0&quot; /&gt;
&lt;/ItemGroup&gt;
</code></pre><p>Then, open a new command line and add an initial migration using <code>dotnet ef migrations add InitialMigration</code> (<strong>but don&#39;t apply it!</strong>).</p>
<h2 id="update-your-packages-references-1">Update your packages references</h2>
<h2 id="update-your-packages-references-2">Update your packages references</h2>
<p>For that, simply update your <code>.csproj</code> file to point to the newest OpenIddict packages:</p>
<h3 id="aspnet-core-1x-1">ASP.NET Core 1.x</h3>
<h3 id="aspnet-core-1x-2">ASP.NET Core 1.x</h3>
<pre><code class="lang-xml">&lt;ItemGroup&gt;
&lt;PackageReference Include=&quot;OpenIddict&quot; Version=&quot;1.0.0-rc2-final&quot; /&gt;
&lt;PackageReference Include=&quot;OpenIddict.EntityFrameworkCore&quot; Version=&quot;1.0.0-rc2-final&quot; /&gt;
&lt;PackageReference Include=&quot;OpenIddict.Mvc&quot; Version=&quot;1.0.0-rc2-final&quot; /&gt;
&lt;/ItemGroup&gt;
</code></pre><h3 id="aspnet-core-2x-1">ASP.NET Core 2.x</h3>
</code></pre><h3 id="aspnet-core-2x-2">ASP.NET Core 2.x</h3>
<pre><code class="lang-xml">&lt;ItemGroup&gt;
&lt;PackageReference Include=&quot;OpenIddict&quot; Version=&quot;2.0.0-rc2-final&quot; /&gt;
&lt;PackageReference Include=&quot;OpenIddict.EntityFrameworkCore&quot; Version=&quot;2.0.0-rc2-final&quot; /&gt;
@ -380,7 +396,7 @@ For that, call <code>ticket.SetResources()</code> with the list of the client id
ticket.SetResources(&quot;tracking_api&quot;, &quot;marketing_api&quot;);
</code></pre><h2 id="optionally-update-your-code-to-grant-applications-the-minimum-required-permissions">Optionally, update your code to grant applications the minimum required permissions</h2>
<p>Starting with RC2, OpenIddict includes an optional feature codenamed &quot;app permissions&quot; that allows
<p>Starting with rc2, OpenIddict includes an optional feature codenamed &quot;app permissions&quot; that allows
controlling and limiting the OAuth2/OpenID Connect features a client application is able to use.</p>
<p>To learn more about this feature, read the <a href="../configuration/application-permissions.html">Application permissions documentation</a>.</p>
<h2 id="list-of-changes-for-applications-using-custom-stores">List of changes (for applications using custom stores)</h2>

View File

@ -69,7 +69,7 @@
"output": {
".html": {
"relative_path": "guide/migration.html",
"hash": "U8aFtN889NYTxdfPRr5BsQ=="
"hash": "GQn0OStWoMBdgOEuXTyzlA=="
}
},
"is_incremental": false,